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
262
Row highlight with group
posted

 Hi I run a simple loop to highlight a row based on some value in a cell

foreach (UltraGridRow orow in this.ultraGrid1.Rows ){
         if (orow.Band.Columns .Cells["Status"].Value.ToString().ToUpper() == "CLOSED")
                   orow.Appearance.BackColor = Color.PaleGoldenrod;
}

The problem is when i group the grid on some column
"orow.Band.Columns .Cells["Status"]." retuns me null , how can i locate the correct row even if i group the grid result upto maximum level.

Please advice

 

Parents
No Data
Reply
  • 469350
    Offline posted

    Looping through all the rows is not a very efficient way to do this. What I would recommend is that you use the InitializeRow event of the grid. You can examine the row and check e.Row.IsGroupByRow to distinguish GroupByRows from real data rows. 

    Also, you might want to check out the WinGrid Performance Guide for some tips on how to make this code more efficient. 

Children
No Data