DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 23 Aug 2007 11:29:29 -0000,    posted on: microsoft.public.dotnet.framework.windowsforms.databinding        back       

Thread Index
  1    Martin P


How can I tell if a control is databound?   
Hi all

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
'================
Date:Thu, 23 Aug 2007 11:29:29 -0000   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us