We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Out of Bounds Exception when Virtual Model Changes

I am using the QueryCellInfo, SaveCellInfo, QueryRowCount, QueryColumnCount et. al. events to manage, populate, and persist the cells in a grid. I am using an underlying model ( as in model, view, control ) of my own construction to hold the data which the grid displays. When the model changes ( has fewer row objects for example ) I am finding that no matter what I try ( calling resetVolatileData, and/or explicitly setting the RowCount parameter on the gridControl) the grid still thinks the model has the old number of rows and asks for data which overflows the bounds of my cache. Am I missing something ? Thx, Bob

1 Reply

AD Administrator Syncfusion Team December 6, 2002 10:32 PM UTC

Bob, If you are trying to use a true virtual grid, you should never explicitly set GridControl.RowCount (or GridControl.Model.RowCount). Doing so, makes the GridData object allocate storage for that many rows. In a virtual grid, you don't want the grid to allocate any row storage. Instead, you want the grid to use exactly the same data (and hence data storage) as your external data source. You do this by only providing the rowcount exclusiively through QueryRowCount. So, if your external data source removes/adds rows, then try calling GridControlResetVolatileData followed by GridControl.Refresh. You should not have to do anything in regard to setting GridControl.RowCount as your QueryRowCount should auotmatically provide the correct row count based on your external data source. Clay

Loader.
Live Chat Icon For mobile
Up arrow icon