M
Martin P
Hi all
Firstly, sincere apologies for cross posting this, I did post on the
DataBinding forum but the traffic there is very low so I'm not
confident of a reply.
Anyway, I'm trying to put together a method to loop through all
controls on a
form and see if any of them are databound.
For simple binding this seems to be straight forward enough (by
checking the control.Bindings collection as in the example below),
but
this doesn't work for combo boxes or datagridviews (and probably
numerous other items).
Does anyone know how I can check any type of control to establish
whether it's bound or not - whether it's simple or complex binding?
Thanks a lot in advance
Martin
Code snippet to check for simple binding - this would be called for
each control on a form:
'================
Public Sub GetBoundControls(ByVal caller As Control)
Dim ctl As Control
For Each ctl In caller.Controls
If ctl.DataBindings.Count > 0 Then
' do some work here
End If
Next
End Sub
'================
Firstly, sincere apologies for cross posting this, I did post on the
DataBinding forum but the traffic there is very low so I'm not
confident of a reply.
Anyway, I'm trying to put together a method to loop through all
controls on a
form and see if any of them are databound.
For simple binding this seems to be straight forward enough (by
checking the control.Bindings collection as in the example below),
but
this doesn't work for combo boxes or datagridviews (and probably
numerous other items).
Does anyone know how I can check any type of control to establish
whether it's bound or not - whether it's simple or complex binding?
Thanks a lot in advance
Martin
Code snippet to check for simple binding - this would be called for
each control on a form:
'================
Public Sub GetBoundControls(ByVal caller As Control)
Dim ctl As Control
For Each ctl In caller.Controls
If ctl.DataBindings.Count > 0 Then
' do some work here
End If
Next
End Sub
'================