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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

2692 Feb 9,2003 02:59 PM Feb 10,2003 06:24 AM Windows Forms 2
loading
Tags: GridControl
Wayne Hartell
Asked On February 9, 2003 02:59 PM

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!

Administrator [Syncfusion]
Replied On February 9, 2003 06:36 PM

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.

Wayne Hartell
Replied On February 10, 2003 06:24 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;