G
Guest
I am having some strange behavior trying to clear some textboxes on a form
that is bound to a datatable. The bizarre thing is that I have about 10
bound text boxes on my form, but I am only having trouble with two of them.
I have a button on my form, that when pushed, needs to clear the contents of
all the fields. So I enter values in all my textboxes and use the following
code to clear the textboxes.
For i = 0 To Me.Controls.Count - 1
If TypeOf (Me.Controls(i)) Is TextBox Then
Me.Controls(i).Text = Nothing
End If
Next
At this point, all the values clear from the form. But, when I End the
Current Edit via...
Me.BindingContext(datatable).EndCurrentEdit()
Two of my textboxes reinsert the values they had in there before they were
cleared, all of the other textboxes clear fine. I have tried renaming the
textboxes, deleting and reinserting them, nothing seems to work. Same two
textboxes everytime. For that matter, I try to clear the contents using the
SIP, but the numbers will not go away. Anybody have any suggestions?
Thanks!
Mike
that is bound to a datatable. The bizarre thing is that I have about 10
bound text boxes on my form, but I am only having trouble with two of them.
I have a button on my form, that when pushed, needs to clear the contents of
all the fields. So I enter values in all my textboxes and use the following
code to clear the textboxes.
For i = 0 To Me.Controls.Count - 1
If TypeOf (Me.Controls(i)) Is TextBox Then
Me.Controls(i).Text = Nothing
End If
Next
At this point, all the values clear from the form. But, when I End the
Current Edit via...
Me.BindingContext(datatable).EndCurrentEdit()
Two of my textboxes reinsert the values they had in there before they were
cleared, all of the other textboxes clear fine. I have tried renaming the
textboxes, deleting and reinserting them, nothing seems to work. Same two
textboxes everytime. For that matter, I try to clear the contents using the
SIP, but the numbers will not go away. Anybody have any suggestions?
Thanks!
Mike