Issue:
The virtual grid has data and a row is selected in it. Now the data is cleared and ResetVolatileData is called. When Refresh is called, the QueryCellInfo gets fired for the selected row index which is no more valid and exception is thrown.
Steps to reproduce:
.Net2.0, VS2005 and Essential Studio: 4.4.0.51
Execute the attached sample. Click on 'Load Data' button. Data will be loaded and donot select any row. Clicking on the same button will clear all data. No problem so far. Now click again on 'Load Data' button and select one of the rows. Click on the same button to clear all data, ArgumentOutOfRangException is thrown.
Scenario briefly:
I have readonly virtual grid derived from grid control (FFGrid). The data for the grid is provided by class implementing IVirtualGridDataProvider interface. In the sample attached, this class is ListDataProvider and this is attached to the grid using FFGrid.WireDataProvider().
When there is change in data, the data provider raises event for which the grid is listening. The code inside event handler:
this.Model.ResetVolatileData();
CalculateColRatios();
The CalculateColRatios() recalculates the col ratios based on new data and calls Refresh(). During this step the error is happening.
why is QueryCellInfo being fired for rowindex > 0 even though the row count is 0 ?
Another issue, the sort icon doesn't get displayed clicking on the header column.
Let me know how do I fix the above issues. Thanks.
Regards
Kiran
POC.FFGrid.zip