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
close icon

ggc.Table.CancelEdit() - not good enough

Hi everybody,


I have a scenario that requires me to use CancelEdit() from within TableControlCurrentCellAcceptedChanges (when data validation fails).

Using CancelEdit() alone causes "AddNew not called" exception when I re-edit the cell without losing focus.

I tried to send Esc key, but then there are situations in which the cell's buffer (the new-rec buffer actually) is not cleared, and re-entering a field causes the other, previously edited fields, to display the bad data without the TableControlCurrentCellAcceptedChanges validation.

So:
1) (the preferred solution) How do I override the "AddNew" problem ?
2) (an undesired alternative) If the above is impossible, how do I clear the edited cell's buffer after calling CancelEdit() ?


Thnaks in advance.

4 Replies

RH Ryan Hardoon May 9, 2007 12:15 PM UTC

Assuming TableControlCurrentCellAcceptedChanges validation is good, how do I force "AddNew" from within TableControlCurrentCellAcceptedChanges - if and only if the currently edited record does not already represent a valid data (DataRow) in the ggc's DataSource (DataSet) ?


RH Ryan Hardoon May 9, 2007 02:36 PM UTC

I just noticed that SendKeys() actually made no difference.
The cell's buffer is not cleared either way.

Please assist ASAP.


Best regards.


RH Ryan Hardoon May 9, 2007 10:38 PM UTC

Somebody . . .

Anybody . . .

? ? ?


HA haneefm Syncfusion Team May 9, 2007 11:34 PM UTC

Hi Ryan,

If you want to actually add new items to the arraylist(IList) through the GridGroupingControl, then you should also have your arraylist implement IBindingList to support the addnew functionality directly from the grid. Please refer this sample:

C:\Program Files\Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Grouping.Windows\Samples\CustomCollections\StronglyTypedCollection\

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon