You just create the required number of rows in iGrid with one simple call, for example:
iGrid1.Rows.Count = 100000
Then you simply access rows in your db from the CellDynamicContents event handler. You will access only the rows that are visible on the screen. If the grid can display say 22 rows in the viewport, only those rows will be accessed. You even will not need to access say 100 rows if you planned to page iGrid by 100 rows.
Perhaps, we are talking about different things. Perhaps, your db does not allow random access to rows (for instance, if you use so called forward-only recordsets or ADO.NET data readers that can read records only in one direction).
Give us more details about your project so we can be more helpful.
Hi, i implemented the paging support in a different way, only have a couple questions/comments
1. The CellDynamicContents event handler is called every time the row is on the screen, even if nothing has changed, this resulted in slow performance since i had to process every row more than once, is this the expected behavior, that it redraws the row every time it is on the screen and while scrolling?
2. Is it possible to programmatically reload a single row so that i can update images on columns or change the font style or color? I looked into this but it looks like there's no way to request a single row refresh or update in place, without having to rely on other events like scrolling or the CellDynamicContents event handler, since it will not be triggered if something happened behind the scenes on my backend.
3. Finally, i noticed that when i load another set of rows into the screen, i would get the CellDynamicContents event handler called for the new last row even if it was not on the screen at the time. For example say i had 100 rows, i add another 100, then i get the event handler calling me with e.RowIndex == 199, but that row is not on the screen or even close, the grid seems to somehow still request the data for that row, which confuses my code since it believes we have scrolled to the end of the grid again. Is there a way around this? Is this a known effect or maybe i'm understanding wrong how the CellDynamicContents feature works? i thought it would only be called for items currently being displayed on the screen, like if i have a 100 rows but only 10 are visible only those get called and if i add another 100 no event handler for CellDynamicContents will be called because the new rows are not on the screen at all?
Thanks for your quick answers and help
Regards