|
-
Feb 24th, 2012, 10:29 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] DataGridView and RowValidating and Escape Delete Error
Hi
I have a bounded datagridview and have some code in row validating event. When i add a new line by writing something in one of the cells of the new row, and if in the middle of the process i wish to cancel this new row, if i use the escape key i get an exception, something like, Index (number of the removed row) does not have a value. After the exception the exception the row it's removed...
How can i make the row validating to work correctly?
I have this code in the start of rowValidating
vb.net Code:
If MyDataGridView.Rows(e.RowIndex) IsNot Nothing AndAlso Not MyDataGridView.Rows(e.RowIndex).IsNewRow Then
'...code..
End If
Rate People That Helped You
Mark Thread Resolved When Resolved
-
Feb 27th, 2012, 12:31 PM
#2
Thread Starter
Frenzied Member
Re: DataGridView and RowValidating and Escape Delete Error
Rate People That Helped You
Mark Thread Resolved When Resolved
-
Feb 27th, 2012, 03:22 PM
#3
Re: DataGridView and RowValidating and Escape Delete Error
Have you checked e.Cancel in RowValidating
-
Feb 28th, 2012, 04:42 AM
#4
Thread Starter
Frenzied Member
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
|