I'm binding a collection of collections to a WPF datagrid component(external library) and the underlying DataSource
has the following structure. This basically gives me a datagrid with hierarchical records
class DataGridItemType
{
public string weightType;
public string SourceType;
private BindingList<DataGridItem> typeCollection = new BindingList<DataGridItem>();
}
BindingList<DataGridItemType> list = new BindingList<DataGridItemType>();
list
is the datagrids DataSource and this performs hierarchical binding. Now, I tried binding a component(The header label of the records one level into the hierarchy whose datasource is typeCollection) to the variable weightType
by using, Text="{Binding Path=weightType, Mode=TwoWay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type btm:DataGridItemType}}}
but the binding doesn't work. Am I missing something?