Can someone please explain to me the purpose of setting or not setting e.Handled = true in the SaveCellInfo event when working with the grid in virtual mode. The Syncfusion documentation states that: "If you made changes to Style you should also set Syncfusion.ComponentModel.SyncfusionHandledEventArgs.Handled to true. The grid will check this flag to see whether the style has been changed from its original settings." Given that my event handler only updates the "Text" property and does not change Style, I am not setting e.Handled = true, and it seems that the grid works fine until the row count exceeds 11 rows, then a rowIndex out of range exception is thrown at SFTable.cs line 353 in the grid code. Setting e.Handled = true fixes the problem, since the code that throws the exception never executes in that instance. (The code bails out in the SetCellInfo method by returning true if e.Handled == true). Going by the letter of the documentation it seems like this is a bug in the Syncfusion grid, because I can't see a way to get the grid to work without setting e.Handled = true and the documentation seems to suggest that it should only be set to true if also answering Style information which I am not doing!!! Please help!
The purpose of e.handled in SaveCellInfo in a virtual grid is to tell the grid whether it should try to store the style information (which includes the text) into the Model.GridData object.
Setting e.Handled to true tells the grid not to store anything (because you have already stored it in your external data source).
If you do not set it to true, then that indicates that you want the grid to try to store it. And this will be a problem unless you allocate (meaning explicitly setting the RowCount/ColCount properties) so there will be space allocated for the values you want the grid to save. The reason things work up to 10 is that is the default value of RowCount.
So, if you want you grid to be a true virtual (that does not need data stored in the GridData object), then you should set e.Handled equal true.
WHWayne HartellFebruary 10, 2003 11:24 AM UTC
Thanks for the help. This morning I was suspecting that what you said might be the case. For some reason I wasn't associating Text with Style and of course that was my fatal mistake. Thanks also for explaining the 10 rows thing.