Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / October 2004

Tip: Looking for answers? Try searching our database.

How to determine a control's databinding?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
*no spam* - 20 Oct 2004 11:48 GMT
When given the name of a control, is there a way (programatically) to
determine its databinding?
Scave - 21 Oct 2004 03:31 GMT
> When given the name of a control, is there a way (programatically) to
> determine its databinding?

Take a look at Control.DataBindings. This collection contains multiple
data bindings. You have to know which property of the control you're
interested in to get a specific data binding.

For example, if I bind a text box as follows:
   TextBox boundTextBox = new TextBox();
   boundTextBox.DataBindings.Add("Text", someDataSource,
someDataMember);

Then I can access that binding later on just by indexing it in the
DataBindings collection as follows:
  DataBinding textBinding = boundTextBox.DataBindings["Text"]

This is my first post and I'm no expert but I hope that helped. Let me
know if I misunderstood your question.
*no spam* - 21 Oct 2004 11:31 GMT
Doh! That's almost too easy :)   Thanks!!  Thats exactly what I was looking for...

> > When given the name of a control, is there a way (programatically) to
> > determine its databinding?
[quoted text clipped - 14 lines]
> This is my first post and I'm no expert but I hope that helped. Let me
> know if I misunderstood your question.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.