DataGridView - IsCurrentRowDirty

  • Thread starter Thread starter Bill Yanaire
  • Start date Start date
B

Bill Yanaire

Using VB.NET 2005, Windows Form and I bind a DataGridView to a table

dgvFees.DataSource = 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 DataGridViewRow In Me.dgvFees.Rows
If dgvFees.IsCurrentRowDirty = True Then
ChangesDone = True
Else
ChangesDone = False
End If
Next



Sometimes it works and sometimes it doesn't. I can't pinpoint why it does.
I have debugged and there is no rhyme or reason as to why it isn't always
true when changes are made.

If anyone could give me some pointers, I would appreciate it.

Thank you.
 
Bill,

Ever watched where the cursor is as you run your test. In other words, did
it leave the tested field after the change or not?

Cor
 
Yes, I made changes to some cells and then clicked on another control, the
code I posted ran. It just doesn't set the IsCurrentRowDirty to true. I
did step through the loop for each record and it was always false.
 
Bill,

The isDirty is a strange kind of property in dotNet (it is more used by Java
and Unix AFAIK), we mostly use Haschanges on the datasource.

Cor
 
Back
Top