Form / Dataset Changes

  • Thread starter Thread starter Mitchell Vincent
  • Start date Start date
M

Mitchell Vincent

I have the follow function for detecting when my bound dataset has
changed (by the user, I hope).


Public Function HasFormChanges() As Boolean

Dim row As DataRow
Dim i As Integer = 0

For i = 0 To (Me.DataTable.Rows.Count - 1)

row = Me.DataTable.Rows(i)

Select Case row.RowState

Case DataRowState.Added
Return True

Case DataRowState.Modified
Return True

Case DataRowState.Deleted
Return True

End Select

Next

Return False

End Function


However, now that I know *something* has changed, I'd like to know what.
Is there any way for me to know what column header holds the value that
is added, modified or deleted?
 
Mitchell,

With a lot of saving and using reject changes probably you can, however what
it the reason you want this. Should you not tackle the user direct at the
begin?

Cor
 
Hi

Have you tried to take a look at the DataTable event?
DataTable.ColumnChanged Event
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdatadatatableclasscolumnchangedtopic.asp

Working with DataTable Events
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconworkingwithdatatableevents.asp

Is this what you want? If you still have any concern, please feel free to
post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Cor said:
Mitchell,

With a lot of saving and using reject changes probably you can, however what
it the reason you want this. Should you not tackle the user direct at the
begin?

Cor

Actually, that function is returning changes as soon as the form is
loaded and I have no idea why. I was going to see if I could find out
*what* column was holding the changed data so I could track down where
it is being changed and why.
 
Back
Top