Jul 11, 2010 at 9:05 AM

I am upgrading from version 2 to version 4, and can't find any examples of virtual grids, where the data is stored by the application instead of inside the grid itself. Can anyone point me to an example that does this, or does anyone know how to do it in the latest version?

Jul 11, 2010 at 10:08 AM

VirtualGrid is not intended to be used directly by end user in most cases. VirtualGrid is the bare bones that provide the whole infrastructure for grids.

I suppose DataGrid is what you are looking for, it is built on top of VirtualGrid

Jul 12, 2010 at 6:12 PM

Yup, as Darius mentioned, you need to provide your own storage, VirtualGrid just handles the display.

Per the documentation:

To use GridVirtual it is therefore necessary to create a class that derives from GridVirtual and personalize the reading of the data source overriding CreateRowsObject, CreateColumnsObject and GetCell methods. 

Source grid provides two controls that implement GridVirtual:

DataGrid - A grid bound to a DataView or generic List object

ArrayGrid - A grid bound to an Array object.

The documentation states that:

If you want to create your custom control to read from a specific data source you can see ArrayGrid class for an example.
If you look through the samples in the Source Grid - Extensions section, you should find about 7 examples of how to use DataGrid/ArrayGrid.


Jul 13, 2010 at 7:37 AM

In latest SourceGrid i also introduced a concept of PingGrid.

PingGrid is basically the same as DataGrid, except that it can work with different data soruces.  On contrast, DataGrid works with only DataSet (which is used internally), but with PingGrid you can implement whatever kind of storage you want.  At the moment there are only 4 demo implementations: one is based on List, another on DataSet, third on Essent (an internal windows database), and fourth one on NHibernate.  With NHibernate datasource, the grid is populated directly with data from database. It also implements very dummy caching strategy.

With NHibernate, Essent and DataSet sources you can show 100k rows easily. 1000k rows is also possible, bet then it comes to performance issues with sorting (which SourceGrid has nothing to do with that). So basically if you use NHibernate datasource, then your database must do all the sorting, which gets complicated, since you can not put indexes on every column.

Anyways, none of the PingGrid is ready for production, it is just for demo and technical possibilities purposes only.


Jul 14, 2010 at 7:26 AM

Thanks for your responses. I have been using GridVirtual for years now and I am very happy with it, so I'd like to stick with it if possible. What I was really wondering was if there was a demo grid that showed the use of GridVirtual, however I'll try my existing code with the latest SourceGrid and see what happens.


Jul 14, 2010 at 11:28 AM
>if there was a demo grid that showed the use of GridVirtual, Technically, ALL of the examples use GridVirtual, since all grids are derivatives of GridVirtual. You are updating from a version which is very old. This is why you have so much new changes, not surprisingly. You should update SourceGrid version at least once a year to minimize the impact of upgrading to new software version. I have never even seen SourceGrid2, since when i came to SourceGrid project where was already version 4 :)