Hi,
I am looking to implement a three level hierarchy whereby the child grids are determined on the run time. For example if we select an option from a combo box present on the parent grid, it will create a child grid. Similarly we could repeat the same scenario for the child grid as well. I am looking into doing this by creating hierarchical templates for both the parent and the child:
// The Child will host another template that will define it's own child.
What would be the best way to tackle this scenario. Should I just go by creating the grids through code behind? I would like to stick to xaml. Any pointers would help me decide !
Thanks,
Farhan
I am looking to implement a three level hierarchy whereby the child grids are determined on the run time. For example if we select an option from a combo box present on the parent grid, it will create a child grid. Similarly we could repeat the same scenario for the child grid as well. I am looking into doing this by creating hierarchical templates for both the parent and the child:
<telerik:RadGridView x:Name="rgvData" CanUserFreezeColumns="False" GridLinesVisibility="Horizontal" ItemsSource="" IsReadOnly="True" AutoGenerateColumns="False"> <telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition /> </telerik:RadGridView.ChildTableDefinitions> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding OrderDate}" Header="Order Date" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding EmployeeID}" Header="Employee" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Freight}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ShipCountry}" Header="Ship Country" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ShipCity}" Header="Ship City" /> </telerik:RadGridView.Columns> <telerik:RadGridView.HierarchyChildTemplate> <DataTemplate> <telerik:RadGridView x:Name="RadGridView1" CanUserFreezeColumns="False" AutoGenerateColumns="False" ShowGroupPanel="False" IsReadOnly="True"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerID}" Header="Customer ID" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Address}" Header="Address" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding City}" Header="City" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Country}" Header="Country" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </DataTemplate> </telerik:RadGridView.HierarchyChildTemplate> </telerik:RadGridView>What would be the best way to tackle this scenario. Should I just go by creating the grids through code behind? I would like to stick to xaml. Any pointers would help me decide !
Thanks,
Farhan