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

SaveCellInfo - Setting e.Handled = true. 2B or not 2B.

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!

2 Replies

AD Administrator Syncfusion Team February 9, 2003 11:36 PM UTC

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.

WH Wayne Hartell February 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.

Live Chat Icon For mobile
Up arrow icon