|
-
May 3rd, 2007, 08:15 AM
#1
Thread Starter
PowerPoster
gridview clears record?
Just been chucked into the deep end of a project and having a hard time remembering or understanding why its doing this. Basically there are some validation rules when entering data into a DataGridView.
Now, if it fails, an error message is given - great (in the DataError event) and then the entire row of data is cleared out - but we dont want this.
The e.Cancel = false is set but still for some reason, the entire row of data is being cleared.
So, we enter some data into a new record in the DGV.
One cell has a validation rule, if it fails, the dataError in the DGV is raised....
error is shown
the entire data is cleared from that row
What can I check to prevent it from happening at all?
looking further, there is an AddingNew event created for the DGV bindingsource which creates a new entry for that row, and shows its wiping out the data of course. how can we prevent that from happening when the validation fails/DataError event has been raised? Obviously want to do it the proper way, rather than say having a boolean value to look at globally to indicate if it should enter a new row or not
Last edited by Techno; May 3rd, 2007 at 08:27 AM.
-
May 3rd, 2007, 09:29 AM
#2
Thread Starter
PowerPoster
Re: gridview clears record?
figured it out thankfully....EndEdit() on the databindingsource object!
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
|