Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
504
How to find parent of selected Row
posted

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?

 

Parents
No Data
Reply
  • 5739
    Verified Answer
    posted

    Hi,

    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();

    Ed

Children