Hi,
I'm using code similar to video example and some posts here to retrieve row data from a whdg with single-row selection:
var grid = ig_controls["ctl00_cphMain_whdg1_ctl00"] var behav = grid.get_behaviors(); var rows = behav.get_selection().get_selectedRowsResolved(); if (rows.length > 0) { var row = rows[0]; $get("txtGAG").value = row.get_cellByColumnKey("GAG").get_value(); if (row.get_cellByColumnKey("MXST")) $get("txtXST").value = row.get_cellByColumnKey("MXST").get_value(); else $get("txtXST").value = ""; lastRow = row;
... but need to obtain a field from the parent row when a row in the 2nd band is selected. How do I most easily identify the parent row?
Ah got it. I had called .get_grid().get_parent() instead of .get_grid().get_parentRow()
All good now thanks.
I didn't test it out but I see that the get_parentrow returns a containergridrow object which supports all of the get_cell... properties.
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.2/CLR3.5/html%5CWebHierarchicalDataGrid~Infragistics.Web.UI.ContainerGrid~parentRow.html
Ed
Thanks for the link and suggested code. It's mostly got me there (I think).
However, the row parentRow returned doesn't support .get_cellByColumnKey() nor related get_cell functions. I assume I'm just missing another layer of .get_something() ??
I think this help doc will do the trick.
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.2/CLR3.5/html%5CWebHierarchicalDataGrid_Hierarchical_View.html
var row = childGrid.get_rows().get_row(0);// Get container owner Container Grid var g = row.get_grid(); // Get parent row var parentRow = g.get_parentRow();
var
// Get container owner Container Grid
// Get parent row