I need to pull the total number of rows that is in a grid. I normally use this property:
ultraGrid.Rows.Count.ToString();
It works unless the user is using a group by on a column. So if using the group by breaks the records into two groups the property above gives me "2" instead of the actual number of records that are in the grid.
Help!
When you group a grid, the grid's Rows collection contains instances of group-by rows (class UltraGridGroupByRow), rather than rows representing your data. Because of this, it's expected that the grid's Rows.Count property will return the number of groups you have.
Instead, use the grid's Rows.GetFilteredInNonGroupByRowCount property. This will also remove from your count any rows that were filtered out.
If you need to include rows that were filtered out, you can use the Rows.GetAllNonGroupByRows() method to get an array of all non-group-by rows, and then look up the Length of that array.