Net datagridview rowvalidating


If anyone could give me some pointers, I would appreciate it. Yes, I made changes to some cells and then clicked on another control, the code I posted ran.It just doesn't set the Is Current Row Dirty to true.I did step through the loop for each record and it was always false. NET 2005, Windows Form and I bind a Data Grid View to a tabledgv Fees.Data Source = tbl I make some changes to the cells in the grid and when I leave the grid, Irun the following code: For Each DR As Data Grid View Row In Fees. Is Current Row Dirty = True Then Changes Done = True Else Changes Done = False End If Next Sometimes it works and sometimes it doesn't. I have debugged and there is no rhyme or reason as to why it isn'talways true when changes are made.Interaction with the Data Grid View often requires that you programmatically discover which cell is currently active. You can perform these tasks with the Current Cell property.Note The feedback system for this content will be changing soon. If content within a comment thread is important to you, please save a copy.If the event handler for the Cell Validating event finds that the value is an empty string, the Data Grid View prevents the user from exiting the cell until a non-empty string is entered. For a complete explanation of this code example, see Walkthrough: Validating Data in the Windows Forms Data Grid View Control.



In order to complete this walkthrough, you will need: Data Grid View Binding Source Data Entry in the Windows Forms Data Grid View Control How to: Validate Data in the Windows Forms Data Grid View Control Walkthrough: Handling Errors that Occur During Data Entry in the Windows Forms Data Grid View Control Protecting Connection Information Note The feedback system for this content will be changing soon. If content within a comment thread is important to you, please save a copy.Data Source = tbl I make some changes to the cells in the grid and when I leave the grid, I run the following code: For Each DR As Data Grid View Row In Fees. Is Current Row Dirty = True Then Changes Done = True Else Changes Done = False End If Next Sometimes it works and sometimes it doesn't. I have debugged and there is no rhyme or reason as to why it isn'talways true when changes are made.If anyone could give me some pointers, I would appreciate it. Canceling this event prevents the user from exiting the cell until a valid value is entered or the edit process is canceled (via Esc key).