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

Loading Nested Grid Rows

1 Answer 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 03 Dec 2012, 08:02 PM
Hi,

I got a hierachy nested grid with a parent row, which have two nested expaned rows. During testing, I loaded 50 records to be binded to the parent row. I see that it binded all 50 parent records first. Afterwards, it starts calling the selecting method to get each of the 50 child records to bind the nested row. I have a following code and checekd the ObjectDataSourceSelectingEventArgs parameter but could not find a record index field on which parent record it is seeking to retrieve the record for binding to the grid. I noticed that for the nested row or the inner record, it calls the selecting and then it call the GetData(string sortColumns, int startRecord, int maxRecords) method for each of the 50 parent record.

Also, how can I pass around in the markup page, the UID that is the primary - foreign table key as the datakeynames. When the child record is called on the selecting method, maybe I can get the datakeyname value to do the fetch.

 

 

protected void Response_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)

 

{

 

 

int test = 0;

 

}

Why am I asking this question> ? The grid is loading for the first time, I need to know which child record is being requested for binding under the parent row. When I get the index, I will do another fetch from the IQueryable object to return a list object.

Any help is appreciated...

1 Answer, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 06 Dec 2012, 11:44 AM
Hello John,

In order to achieve your scenario you could loop through all the RadGrid child GridTableView controls and access the parent id in the Page PreRender event where the filtering of IQueryable could be executed. Note that in the Selecting event there is no way to access which is the parent id. You could go through the help article below to observe how to retrieve the primery key values.


Kind regards,
Antonio Stoilkov
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
John
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Share this question
or