Hi, I have this Ultragrid that can be group by column. In my code I have to loop through its rows to get/set a specific cell value. My code goes like this:
foreach(var item in MyGrid.Rows)
{
if((bool)item.Cells["Check"].Value)
item.Cells["ItemToBeFilledIn"].Value = MyTextBox.Text;
}
Everything goes well if it is not grouped. But when I drag a column and group it by itself, there will be an exception message. When I try to debug, I saw that item.Cells is NULL.. Why? How can I get values from that cell?
This loops through all possible childbands.
Ok, now I get it. Here's the code I used:
var allRowsEnumerator = MyGrid.Rows.GetRowEnumerator(GridRowType.DataRow, null, null);
foreach (UltraGridRow childRow in allRowsEnumerator)
if((bool)childRow.Cells["Check"].Value)
childRow.Cells["ItemToBeFilledIn"].Value = MyTextBox.Text;
That's what I did. But I'm still open for any other suggestion