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
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.