Hi,
We are trying to populate the parent / child data in hierarchical gridview at runtime. Columns of the grid view is based on the login user. So, we are not set the columns at design.
We use parent - child relationship as below code logic. We can see the parent details and child details. However, for child details, it is showing all information. It should be shown the data which is associated with the parent data.
<commonData:ExtendedGridView x:Name="HierarchicalGridView1"
Grid.Column="0" Margin="55,27,0,10" Grid.ColumnSpan="2"
CanUserReorderColumns="False" AutoGenerateColumns="False"
ShowGroupPanel="False" RowIndicatorVisibility="Collapsed"
ItemsSource="{Binding Source={StaticResource CollectionVM},Path=ParentCollection}"
commonData:GridViewBindingBehavior.ColumnsCollection="{Binding Source={StaticResource CollectionVM},Path=DynParentColumns}"
>
<telerik:RadGridView.ChildTableDefinitions >
<telerik:GridViewTableDefinition >
<telerik:GridViewTableDefinition.Relation>
<telerik:TableRelation IsSelfReference="False">
<telerik:TableRelation.FieldNames>
<telerik:FieldDescriptorNamePair
ParentFieldDescriptorName="ORDNO"
ChildFieldDescriptorName="ORDNO" />
</telerik:TableRelation.FieldNames>
</telerik:TableRelation>
</telerik:GridViewTableDefinition.Relation>
</telerik:GridViewTableDefinition>
</telerik:RadGridView.ChildTableDefinitions>
<telerik:RadGridView.HierarchyChildTemplate >
<DataTemplate>
<commonData:ExtendedGridView ShowColumnHeaders="False" ItemsSource="{Binding Source={StaticResource CollectionVM},Path=ChildCollection}" AutoGenerateColumns="False" ShowGroupPanel="False"
commonData:GridViewBindingBehavior.ColumnsCollection="{Binding Source={StaticResource CollectionVM},Path=DynParentColumns}" >
</commonData:ExtendedGridView>
</DataTemplate>
</telerik:RadGridView.HierarchyChildTemplate>
Your help is much appreciated.
Thanks
VG