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
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