This question is locked. New answers and comments are not allowed.
I want to display a self referencing table into a TreeListView.
Here is the xaml code:
All items are displayed without any indent so the tree looks like a list.
I'm confused because if I made some small changes and replace the TreeListView with a GridView the items are displayed properly and the items hierarchy is visible
I don't understand why the list and grid controls has different behaviour in the same situation.
Here is the xaml code:
<telerik:RadTreeListView x:Name="radGridView" ItemsSource="{Binding}" AutoGenerateColumns="False"> <telerik:RadTreeListView.ChildTableDefinitions> <telerik:GridViewTableDefinition> <telerik:GridViewTableDefinition.Relation> <telerik:TableRelation IsSelfReference="True"> <telerik:TableRelation.FieldNames> <telerik:FieldDescriptorNamePair ParentFieldDescriptorName="ParentId" ChildFieldDescriptorName="Id" /> </telerik:TableRelation.FieldNames> </telerik:TableRelation> </telerik:GridViewTableDefinition.Relation> </telerik:GridViewTableDefinition> </telerik:RadTreeListView.ChildTableDefinitions> <telerik:RadTreeListView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" /> </telerik:RadTreeListView.Columns> </telerik:RadTreeListView> All items are displayed without any indent so the tree looks like a list.
I'm confused because if I made some small changes and replace the TreeListView with a GridView the items are displayed properly and the items hierarchy is visible
<telerik:RadGridView x:Name="radGridView" ItemsSource="{Binding}" AutoGenerateColumns="False"> <telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition> <telerik:GridViewTableDefinition.Relation> <telerik:TableRelation IsSelfReference="True"> <telerik:TableRelation.FieldNames> <telerik:FieldDescriptorNamePair ParentFieldDescriptorName="ParentId" ChildFieldDescriptorName="Id" /> </telerik:TableRelation.FieldNames> </telerik:TableRelation> </telerik:GridViewTableDefinition.Relation> </telerik:GridViewTableDefinition> </telerik:RadGridView.ChildTableDefinitions> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" /> </telerik:RadGridView.Columns> </telerik:RadGridView>I don't understand why the list and grid controls has different behaviour in the same situation.
