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

Clearing AddNewRecord row

I have a question about unique constraints on an AddNewRecord row. The dataset my grid is bound to has a unique constraint on one of the columns.

If a particular cell is duplicated a grid_ExceptionRaised event is fired. Within this event I try to remove the offending data by doing this:

Record r = this.grid.Table.CurrentRecord;
r.CancelEdit();

Unfortunatly this does not remove the data within the record.

I tried to to remove the data by doing this as well:

this.grid.Table.CurrentRecord.CancelEdit();

This does remove the information but if I try to enter any new info in the AddNewRecord row the value disappears.

How do I remove the data within the AddNewRecord row and have it behave normaly?

2 Replies

AD Administrator Syncfusion Team December 5, 2006 05:16 AM UTC

Hi Rocko,

If you want to cancel the changes in the AddNewRecord,you need to call the Table.CancelEdit method. Please try the suggestion and let me know if this helps.

this.grid.Table.CancelEdit();

Best Regards,
Haneef


RO Rocky December 5, 2006 05:16 PM UTC

The values get cleared but if I try to enter new values into the AddNewRecord row the cell values still disappear as I add them.

Loader.
Live Chat Icon For mobile
Up arrow icon