Search code examples
infragisticsultrawebgrid

How do I access the child rows of an Infragistics Web Grid row?


I need to modify the contents of the child rows of a hierarchical Infragistics web grid when it is expanded. I can get the parent row from "e.Row" in the following code. But how do I get its child rows to edit?

For that matter, how can I get the rows from any band other than band 0?

protected void CustomerActivitiesGrid_ExpandRow(object sender, RowEventArgs e)
{
   UltraGridRow expandedRow = e.Row;
}

Solution

  • It's quite easy, just access the row's rows.

    foreach(UltraGridRow childRow in e.Row.Rows)
    {
        // your code
    }
    

    Subsequently, you can access the children rows of those rows the same way

    childRow.Rows
    

    You can also access a specific row using its key

    UltraGridRow specificChildRow = e.Row.Rows.FromKey("ChildRowKey");