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

Databind a list of child objects to a list in a Grid

1 Answer 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 09 Nov 2011, 05:29 PM
I have a grid where I display records from a parent table.
When I edit the item I want to display a list of the parents child objects. I can do that easily by hooking in the itemdatabound and populating a listbox.
What I then want to do is allow people to add items and for the in form edit in the grid to save the child items as well as the parent.

Do I have to resort to a completely custom update and insert code or can I use some of the automatic updating and inserting functionality.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 14 Nov 2011, 09:25 AM
Hi Simon,

If you are using another RadGrid instance in your parent grid's edit form, you can surely use automatic data source operations by hooking the inner grid to a data source control. You can consider using the FormTemplate feature in RadGrid to have a greater control over the contents in your edit form. Note that the NamingContainer object of all the controls in the edit form is the GridEditFormItem that is your edit form. Using this you can access the parent grid and its items from inside event handlers of your edit form controls, if required.

Veli
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
Simon
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or