I have a checkbox that is bound to a dataview.
When I change the value of the checkbox and click a button, that runs through dataview.endedit, then the .update, it's changes are not saved.
I can get the changes to commit if I change the value of the checkbox field, then activate another control, such as I click on a textbox field that is bound to the same dataview, and then do my .endedit, and .update.
How do I need to handle checkboxes to get this change to update? Is there a common error I'm making?
I'm using Visual Studio 2010, Sql Server 2008, any help would be greatly appreciated. Thank you.
Dataview EndEdit ("SingleLimitUnlimited" is the the value that's not getting updated. If it's checked I'm just nulling out a couple other values.)
When I change the value of the checkbox and click a button, that runs through dataview.endedit, then the .update, it's changes are not saved.
I can get the changes to commit if I change the value of the checkbox field, then activate another control, such as I click on a textbox field that is bound to the same dataview, and then do my .endedit, and .update.
How do I need to handle checkboxes to get this change to update? Is there a common error I'm making?
I'm using Visual Studio 2010, Sql Server 2008, any help would be greatly appreciated. Thank you.
Dataview EndEdit ("SingleLimitUnlimited" is the the value that's not getting updated. If it's checked I'm just nulling out a couple other values.)
Code:
Dim i As Integer
For i = 0 To Me.DataView1.Table.Rows.Count - 1
If Me.DataView1.Table.Rows(i).Item("SingleLimitUnlimited") = True Then
Me.DataView1.Table.Rows(i).Item("SingleLimit") = DBNull.Value
Me.DataView1.Table.Rows(i).Item("SingleMax") = DBNull.Value
End If
If Me.DataView1.Table.Rows(i).Item("MarriedLimitUnlimited") = True Then
Me.DataView1.Table.Rows(i).Item("MarriedLimit") = DBNull.Value
Me.DataView1.Table.Rows(i).Item("MarriedMax") = DBNull.Value
End If
Me.DataView1.Table.Rows(i).EndEdit()
NextCode:
EmployerPlanDataAdapter.Update(Me.DsEmployerPlan1)