SoftwareEng
Senior member
I have a data-bound form (via BindingSource and TableAdapter) and need to detect when the user changes data in a field. Microsoft says, check the row's the "DataRowState" property (if = Modified, then the row changed by user). But it's never equal to that.
What's up with that 🙁
Private Sub theBindingSource_CurrentItemChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tbl_65Election_AccountBindingSource.CurrentItemChanged
Dim thisDataRow As DataRow = CType(theBindingSource.Current, DataRowView).Row
If (thisDataRow.RowState = DataRowState.Modified) Then
MsgBox("modified!")
Else
MsgBox("not modified")
End If
End Sub
What's up with that 🙁
Private Sub theBindingSource_CurrentItemChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tbl_65Election_AccountBindingSource.CurrentItemChanged
Dim thisDataRow As DataRow = CType(theBindingSource.Current, DataRowView).Row
If (thisDataRow.RowState = DataRowState.Modified) Then
MsgBox("modified!")
Else
MsgBox("not modified")
End If
End Sub