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

Detail Table Index on Client and Server Side

1 Answer 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Loi
Top achievements
Rank 1
Loi asked on 23 Jul 2008, 04:49 AM
Hi All,

My name is Loi Nguyen.  I have a hierarchy grid with a Master Table and 3 Detail Tables with a column of Drop Down List.  I want to collapse and expand item based on the value selected from a Drop Down List.  For example, If my user select "Yes" he or she in military, then that user can answer the next set of questions.  I am able to collapse and expand through the following javascript code:

var grid = <%= rgDRFormASPPFQuestion.ClientID %>;
var groupColumnImage;
var tableView = grid.DetailTablesCollection[0];   //Problem here
groupColumnImage = tableView.Rows[RowIndex].Control.cells[0].firstChild;

if(groupColumnImage.src)
{
  groupColumnImage.click();
}


The problem I have here is the hard coded of index in the DetailTablesCollection.  I was able to retrieve a correct RowIndex from the Server Side.  How can I retrieve a correct index for DetailTablesCollection? 

I tried to use the following code to get an index for DetailTablesCollection, but the index I have is totally off from the one in Javascript. 

nestedView.DetailTableIndex

For example, the above code give me back index of 0 and javascript show me that I click on item 6 in DetailTablesCollection.

Any input here is greatly appreciate.

Thanks again.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 24 Jul 2008, 11:00 AM
Hello Loi,

When HierarchyLoadMode="Client" in RadGrid's MasterTableView, you can get a reference to the entire detail tables collection for RadGrid:

$find('RadGrid1').get_detailTables()

This method returns a collection of all the detail tables in all the hierarchy levels. If you have 3 detail tables per item, you can calculate the index for this array required to get the detail table you need based on the item index.

Sincerely yours,
Veli
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Loi
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or