I have a grid with multi band. Now I want to get the number of rows in the top band. How can I do so?
Thanks!
The easiest way to do this would be to get the total number of rows from the underlying DataSource. Otherwise, you would have to look at all of the rows that are children of each parent row (i.e. this.ultraGrid1.Rows[0].ChildBands[0].Rows.Count), or even further down the chain should you need the count for a deeper band. As this would involve possibly recursively looping through all the rows to check this, that is why I suggest getting the count from the DataSource instead.
Edit: You could also use the GetRowsEnumerator method which would prevent you from having to recursively walk down the rows, but you would still have to loop.
-Matt
How can I count the number of rows in a band other than 0?
The Rows collection on the grid contains all the rows in the main band, so you would just look at grid.Rows.Count.