When my grid control is full of rows, I can tell how many rows fit on the screen by looking at ultraGrid1.ActiveRowScrollRegion.VisibleRows.Count. But sometimes the rows in my grid do not fill up the space taken up by the grid control (or, the grid may be scrolled).
Is there a way to determine how many rows would be visible (that is, how many rows fit in the control) even when the grid doesn't have (or doesn't show) enough rows to fill the control?
Yes, all my rows are the same height. So I'll use your suggestion. Something like this gets me close enough:
(ultraGrid1.Height - ultraGrid1.DisplayLayout.Bands[0].Header.Height) / ultraGrid1.Rows[0].Height
No, there's no simple way to do this.If all of your rows are the same height, then you could try to figure out the available area of the grid and divide by the row height, but you would have to account for column headers, borders, and scrollbars so it's not easy to do.