Multiple GridModels and a Single GridControlBaseImp

Hello,

I have multiple Virtual GridModels that I want to be able to modify programmatically in the background (that is, while not attached to a GridControlBaseImp) and then switch the background GridModel to be attached to the GridControlBaseImp and display its contents. In the application I am going to be switching backwards and forwards between GridModels numerous times. I also want to be able to access the contents of the GridModel without attaching it to a GridControlBaseImp, to see all of my changes, and have the QueryCellInfo et al methods getting fired. Is this sort of thing at all possible or should I be trying something completely different?

If it is possible, this is my specific problem. I can switch the models just fine and get the correct results. I am not having any luck modifying the model in the background without having it attached to the grid.

The results I am getting seem to me to mean I am not detaching the previous model properly before attaching to the next model. Also, it kind of looks like requests I am making of the model are getting forwarded to the controlbaseimp rather than calling my QueryCellInfo but that is probably because I haven't hooked things up correctly.

Is it possible to modify a GridModel not attached to a GridControlBaseImp (or any other type of GridControl)? What do I have to do to completely remove the connection between a model and a control?

I suppose an example of how to have a number of virtually bound GridModels, modify them without attaching them to a grid and then switch them around between a single GridControlBaseImp is what I am looking for, if that pattern of use is at all possible.

Thanks,
Ben

1 Reply

AD Administrator Syncfusion Team June 28, 2007 09:37 AM UTC

In a true virtual grid, the GridControl (and hence GridModel) does not really store anything. It serves strictly as a conduit to the virtual data source. So, instead of thinking about have multiple GridModels and 1 GridControl, I think it better fits the grid's virtual architecture, to think about multiple DataSources and 1 GridControl.

Here is a little sample that illustrates this idea. Will something like this serve your needs?


VirtGridMultipleDataSources.zip

Loader.
Up arrow icon