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

[Solved] Hierarchy, binding to object without ID fields

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 18 Mar 2013, 11:35 PM
So I'm trying to use a RadGrid for displaying an object with nested Lists as properties. I have it in a user control so I'm declaring RadGrid in code-behind. The object is passed in through the user control's constructor, all of the data is contained in the object, there is no need for any lazy loading. The object is retrieved from MongoDB so there are no identity fields at any of the levels in the hierarchy (other than the database _id at the very top). So when looking at the demo "Grid - Creating Hierarchy Programmatically", I get stuck at creating GridRelationFields because, as far as my data is concerned, relations aren't necessary.

Does the RadGrid have functionality for using reflection to display the full details of the object I'm trying to bind to it? Is there some way around having to create GridRelationFields? Or will I have to make wrapper objects and programmatically generate and assign ID fields to get this to work?

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 21 Mar 2013, 01:47 PM
Hi Matt,

When you use programmatic binding of hierarchical RadGrid you do not need to set GridRelationFields. In your case into the RadGrid.DetailTableDataBind event handler you need to pass the collection of child related items to the e.DetailTableView.DataSource.

I hope this helps.

Regards,
Radoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or