Row state not working

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I have a winform db app that uses the following code to bind data source to
the form fields;

Private ds As MyDataSet
Dim db As System.Windows.Forms.Binding
Private WithEvents bmCompanyDetails As
System.Windows.Forms.CurrencyManager

db = New System.Windows.Forms.Binding("Text", ds.tblClients, "ID")
txtID.DataBindings.Add(db)

db = New System.Windows.Forms.Binding("Text", ds.tblClients,
"Company")
txtCompany.DataBindings.Add(db)

'...more field bindings

bmCompanyDetails = CType(BindingContext(ds, "tblClients"),
CurrencyManager)

EndWait()

When the user edits some fields and presses Save, following code is
executed;

Dim Row As DataRow

bmCompanyDetails.EndCurrentEdit()
Row = DirectCast(bmCompanyDetails.Current, DataRowView).Row
If Row.RowState = DataRowState.Modified Then
' Update here
End IF

Problem is that despite the fact data is changed in bound fields,
Row.RowState returns Unchanged state. What is the problem and how can I fix
it?

Thanks

Regards
 
John,

Are sure you were not called AcceptChanges() method of dataset any where in
the program flow before the Save operation peformed.

Also make sure that editing is done on the proper row. try changing the
textbox field value fully rather changing some chars.

Thanks
Jibesh
 
Back
Top