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

detail Table ID having the parent grid

3 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jean-Marc
Top achievements
Rank 1
Jean-Marc asked on 20 Jul 2012, 10:36 AM
As i click on a checkbox (template column) in a row of the main grid an event is raised and
a client-side function is called. 

Inside this function I need to do something on its detail table, I don't have, and I need it, the ID of that Detail Table
I did like this:

var grid = $find(gridClientID);
var childGridID = grid.get_detailTables()[ROW].get_dataItems()[0].get_id()

ROW is the index of the main grid row to which the checkbox belongs.

But... 
grid.get_detailTables()[index].get_dataItems()[0].get_id() 
index actually refer to the index of the expanded ones, so if click on the first row (ROW=0) and first row is not expanded and the second row is expanded the action takes place on the second row (ROW=1) because is the first expanded

How do I know
1) detail Table ID having the parent grid?
2) if it's not expanded can I work on it?

Thank you


3 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 25 Jul 2012, 07:09 AM
Hello,

 In the default hierarchy load mode the detail table is not rendered until its row is expanded. So you first need to expand the row in order to access the detail tables.

All the best,
Marin
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.
0
Jean-Marc
Top achievements
Rank 1
answered on 25 Jul 2012, 10:51 AM
Thank you Marin,
i understand, by the way, is there a way to know detailTableID? having the parent grid 
client-side, javascript
0
Accepted
Marin
Telerik team
answered on 26 Jul 2012, 09:05 AM
Hello,

 Only after a row is expanded and the detail table is rendered you can access it's ID:

grid.get_detailTables()[index].get_id()

Regards,
Marin
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
Jean-Marc
Top achievements
Rank 1
Answers by
Marin
Telerik team
Jean-Marc
Top achievements
Rank 1
Share this question
or