|
-
Dec 12th, 2008, 03:13 AM
#1
Thread Starter
Lively Member
[RESOLVED] How to cancel .AddNew()
I have a form and use it to add contact information to a database. Name, Address, etc. My question is there a way to cancel the addNew method.
clientBindingSource.AddNew()
-
Dec 12th, 2008, 04:47 AM
#2
Re: How to cancel .AddNew()
The short answer is CancelEdit.
The long answer is that calling AddNew creates a new DataRowView and adds it to the DefaultView of your DataTable without actually adding the corresponding DataRow to the DataTable itself. To commit the change and add the row you call EndEdit, while to rollback the change and discard the row you call CancelEdit. Note that, in bound controls, pressing the Escape key will invoke the CancelEdit method while navigating away from the row will invoke the EndEdit method.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|