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

[Solved] Heirarchy Grid Question.

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jms
Top achievements
Rank 1
jms asked on 19 Oct 2009, 09:38 PM
Hello,

Little background before the question.

I have an app the has Objects with nested lists of Objects. For ease lets say TEST obj. with list of QUESTION objs.  Is it possible to get the RadGrid to generate a Hierarchical grid by passing a single ObjectDataSource that is a list of TEST objects? If not is it possible to get one displayed using 2 ObjectDataSources with out using the PK/FK relations shown in the tutorial?  Since the objects do not have access to this information.  This is rather desirable for me, and would be used in many instance in the project alone.

Regards,
Jimm


PS. Posted in a wrong forum earlier I edited it Sorry, could not find a delete.

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 22 Oct 2009, 12:24 PM
Hello James sander,

Although our web grid supports binding to sub-object (with flat structure), binding hierarchy to custom objects is not supported out-of-the-box. If you want to attain the hierarchical presentation you mentioned, you have to do that with custom code implementation.

Basically, you will need to define appropriate relations between your custom objects (through properties of those custom objects) and then generate your child tables wiring the DetailTableDataBind event of the grid. Depending on the relations set for the parent row for the grid (how to extract field values from parent item you can find here), you can filter the child table records and set them as source for the e.DetailTableView instance inside the DetailTableDataBind handler.

The other option you have is to parse the data from your custom object in MS DataTables, set references between these tables and then build the hierarchical grid with declarative relations.

Best regards,
Sebastian
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
jms
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or