Thanks Clay. That did the trick. Now I have another related question... The way I currently initialize the virtual grid, I have to specify a certain number of rows and columns to actually fit all the millions of rows... so even if there are only 20 rows to be displayed from the file, I still have millions of empty cells being displayed...
I was wondering if it is possible to dynamically grow the virtual grid size as it is being populated? I tried to pass in the row and column size into "GridRowColCountEventArgs" event as the table grows... but that does not seem to work. The event is only being fired in at initialization and thats it.
>
Here is a little sample. It is implemented using the virtual grid. In QueryCellInfo, it checks for the data availability and loads the data as you scroll over.
>
>At the beginning of QueryCellInfo, there is a call to a DataSource method that ensures the requested row is available. If it is not, the DataSource loads a 200-count range of records with the requested record in the middle. In this sample, loading new data creates a new 200 row datatable using code.
>
>In a real application this table would come from some kind of database query to retrieve a batch of records containing the requested one. In the sample, all this happens very quickly. In a real application, accessing the database will likely be an expensive operation, so bigger page sizes may make sense. Or, you could try to use multiple threads to ''preload'' anticipated batches on different threads so they would be available when needed. Of course, this adds complexity to the coding to make sure the threads are interacting properly. But the basic idea would still be the same. At the start of QueryCellInfo, you somehow have to make sure the requested data is available. If it is not, then you have to get it.