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
1612
How loop through rows in group
posted

Normally I can loop through the rows like that


foreach ( var row in uGrid.Rows )  row.Cells["INCLUDE"].Value = true;

But when grid is in group-by mode row.Cells is null

 

Can you please advice how to loop rows when data is grouped ?

Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    UltraGridGroupByRow exposes a Rows collection which contains its rows. When you iterate the UltraGrid.Rows collection, you can cast each row to typeof(UltraGridGroupByRow), then iterate that UltraGridGroupByRow's Rows collection in a separate loop.

    Example:
    foreach( UltraGridRow row in this.ultraGrid.Rows )
    {
        UltraGridGroupByRow groupByRow = row as UltraGridGroupByRow;
        if ( groupByRow != null )
        {
            foreach ( UltraGridRow r in groupByRow.Rows )
            {
            }
        }
    }

Children