This is a migrated thread and some comments may be shown as answers.

Multiple Child tables in Hierarchy of Gridview

4 Answers 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Maulik Patel
Top achievements
Rank 1
Maulik Patel asked on 16 Mar 2010, 02:12 PM
Hi,

I am trying to use the hierarchy base Gridview. I could able to add one child table into and hierarchy is working fine. But I want to show multiple children for each row. Is it possible?

For example, There is a customer table that is loaded in the GridView. For each row, I would like to show Order table and Payment table in children.

Please do needful.

Regards,
Maulik

4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 16 Mar 2010, 02:21 PM
Hi Maulik Patel,

You should use the Row Details feature of the grid. You can place any number of controls inside the RowDetailsTemplate. In your case this will be some panel with two RadGridView's inside that are bound to Orders and Payments respectively.

Please, read these resource and you will understand how to configure the row details:
Row Details Documentation
Row Details Online Example
Displaying Hierarchical Data with Row Details Blog Post

I hope this helps.

Best wishes,
Ross
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Maulik Patel
Top achievements
Rank 1
answered on 17 Mar 2010, 02:26 PM
Hi Ross,

Thanks for the reply. I took a look of the blog and examples but it is not exactly what I am looking for.

In my case, there is a generic control that has a simple RadGridView in .xaml file. Then there will be multiple child tables that gets added in the hierarchy/rowdetails dynamically (based on the users' configuration). So, I need to create RowDetailsTemplate for RadGridView and it will have multiple child tables added from the code behind and individual DataContext. How do I do it using RowDetails?

Regards,
Maulik P.


0
Accepted
Rossen Hristov
Telerik team
answered on 18 Mar 2010, 10:12 AM
Hello Maulik Patel,

You can create a RowDetailsTemplate with an empty Panel in it. Then you can attach to the LoadingRowDetails event of the grid and dynamically add any number of other controls to this empty panel at runtime. In your case this Panel can be a StackPanel or Grid and you will be adding RadGridView's (child grids) to this Panel. I hope this helps.

Kind regards,
Ross
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Maulik Patel
Top achievements
Rank 1
answered on 19 Mar 2010, 11:57 AM
Hey Ross, it worked. :)

Thanks.
Tags
GridView
Asked by
Maulik Patel
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Maulik Patel
Top achievements
Rank 1
Share this question
or