C# Exception when retrieving rows from a datagrid in virtual mode

Posted by JamesM on Stack Overflow See other posts from Stack Overflow or by JamesM
Published on 2009-07-27T13:47:31Z Indexed on 2010/04/21 10:03 UTC
Read the original article Hit count: 337

Filed under:
|
|

Hi all,

I keep getting an exception (see below) when I retrieve a list of rows from a Virtual Mode datagrid, this only happens when I have more rows than I can display on screen and it doesn't happen every time. Is there anything I'm missing with regards to virtual mode?

Update> The image below shows the problem, the index is now outside the list range. The reason for this is say I have 10 items and I hide 5 as they are not needed and I want to run some code on the 5 that are visible, there are now 5 items but the index of some maybe between 5-9, how can I re-index? When I have run some code on the visible 5 I then show the hidden 5 so I don't want to disgard these, I'd need to reindex again when they are all visible. Many thanks.

alt text

© Stack Overflow or respective owner

Related posts about c#

Related posts about datagridview