G
Guest
I have a user control and I have several textboxes on it. I build the user
control and dropped it on a window's application. I have a typed dataset in
the window's application. I'm trying to bind the controls within the user
control to this dataset. I have the following code in the user control. This
lets me bind controls in the user control to the dataset in the window'
application.
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public Property TextBox1_Binding() As
System.Windows.Forms.ControlBindingsCollection
Get
Return TextBox1.DataBindings
End Get
Set(ByVal Value As System.Windows.Forms.ControlBindingsCollection)
Dim bindings As System.Windows.Forms.ControlBindingsCollection
Dim b As Binding
bindings = CType(Value,
System.Windows.Forms.ControlBindingsCollection)
TextBox1.DataBindings.Clear()
For Each b In bindings
TextBox1.DataBindings.Add(b)
Next b
End Set
End Property
Now the problem is if I change the bindingcontext postion to step through
records, the values in the user control's controls are not refreshing. They
just show the first record values. What do I need to do to be able to refresh
these values?
control and dropped it on a window's application. I have a typed dataset in
the window's application. I'm trying to bind the controls within the user
control to this dataset. I have the following code in the user control. This
lets me bind controls in the user control to the dataset in the window'
application.
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public Property TextBox1_Binding() As
System.Windows.Forms.ControlBindingsCollection
Get
Return TextBox1.DataBindings
End Get
Set(ByVal Value As System.Windows.Forms.ControlBindingsCollection)
Dim bindings As System.Windows.Forms.ControlBindingsCollection
Dim b As Binding
bindings = CType(Value,
System.Windows.Forms.ControlBindingsCollection)
TextBox1.DataBindings.Clear()
For Each b In bindings
TextBox1.DataBindings.Add(b)
Next b
End Set
End Property
Now the problem is if I change the bindingcontext postion to step through
records, the values in the user control's controls are not refreshing. They
just show the first record values. What do I need to do to be able to refresh
these values?