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
2306
.Rows Collection question.
posted

 Hello,

I have a singleBand grid binded to a typed dataset. On the grid i have added (with the designer of the grid) a column with type = bool, and key="Download".

To get all the checked rows i have hooked-up/registered a method on the CellChange event of the grid !

here it is

        private void ultraGrid_ABC_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
        {
            foreach (UltraGridRow row in ultraGrid_ABC.Rows)
            {
                    row.Update();

                    if ((bool)row.Cells["Download"].Value))//if selected

                    {

                          // do something

                    }                   
            }

         } 

this code is working only if i have not grouped-by.

Doing a groupby a column i get a null reference on  row.Cells, so row.Cells is null !

why does not work ?

 

thank you.

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     This won't work because when the grid is grouped, it changes the hierarchy. The top-level rows in the grid will be the GroupBy rows (which have no cells) and the "real" rows will be children of those rows. 

    The easiest way to deal with this is to change how you get the rows. You don't care about the groupby rows for the purposes of this loop, so you can get all the "real" rows like so:  

    foreach (UltraGridRow row in ultraGrid_ABC.Rows.GetAllNonGroupByRows())

Children