473,410 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Loop through all binding sources on a form

Hello there,

I was wondering if anyone knew how to loop through all binding sources on a
form?

I tried the below code but the me.controls collection doesnt return
everything :(
For Each obj As Object In Me.Controls

If TypeOf (obj) Is BindingSource Then

MessageBox.Show(obj.name)

End If

Next

Thank you kindly for reading my message

John Sheppard
Jun 27 '08 #1
4 2847
John,

You need the me.bindingmanager for this, however I could not find in a
reasonable way (I am at home now) good information about this on MSDN.
Maybe you can try it yourself.

Cor

"John Sheppard" <sp**@nospam.comschreef in bericht
news:fu*******@news2.newsguy.com...
Hello there,

I was wondering if anyone knew how to loop through all binding sources on
a form?

I tried the below code but the me.controls collection doesnt return
everything :(
For Each obj As Object In Me.Controls

If TypeOf (obj) Is BindingSource Then

MessageBox.Show(obj.name)

End If

Next

Thank you kindly for reading my message

John Sheppard

Jun 27 '08 #2
Thanks cor...

There is no me.bindingmanager? Do you mean that I should be using the
bindingmanager component instead of a binding source?

I never have any luck with MSDN, I only ever seemed to find technical but
usless information there...always found google to be more useful...

Thank you
John

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:31**********************************@microsof t.com...
John,

You need the me.bindingmanager for this, however I could not find in a
reasonable way (I am at home now) good information about this on MSDN.
Maybe you can try it yourself.

Cor

"John Sheppard" <sp**@nospam.comschreef in bericht
news:fu*******@news2.newsguy.com...
>Hello there,

I was wondering if anyone knew how to loop through all binding sources on
a form?

I tried the below code but the me.controls collection doesnt return
everything :(
For Each obj As Object In Me.Controls

If TypeOf (obj) Is BindingSource Then

MessageBox.Show(obj.name)

End If

Next

Thank you kindly for reading my message

John Sheppard


Jun 27 '08 #3
John,

I could not come on the class either this morning, it is the
bindingmanagerbase and the me.bindingcontext.

Here you find some more infomration.

http://msdn2.microsoft.com/en-us/lib...ngcontext.aspx

Cor

"John Sheppard" <sp**@nospam.comschreef in bericht
news:fu********@news2.newsguy.com...
Thanks cor...

There is no me.bindingmanager? Do you mean that I should be using the
bindingmanager component instead of a binding source?

I never have any luck with MSDN, I only ever seemed to find technical but
usless information there...always found google to be more useful...

Thank you
John

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:31**********************************@microsof t.com...
>John,

You need the me.bindingmanager for this, however I could not find in a
reasonable way (I am at home now) good information about this on MSDN.
Maybe you can try it yourself.

Cor

"John Sheppard" <sp**@nospam.comschreef in bericht
news:fu*******@news2.newsguy.com...
>>Hello there,

I was wondering if anyone knew how to loop through all binding sources
on a form?

I tried the below code but the me.controls collection doesnt return
everything :(
For Each obj As Object In Me.Controls

If TypeOf (obj) Is BindingSource Then

MessageBox.Show(obj.name)

End If

Next

Thank you kindly for reading my message

John Sheppard



Jun 27 '08 #4
Thanks heaps cor...this looks like it might do the job, I will work through
it

Kind Regards
John Sheppard

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:u$**************@TK2MSFTNGP02.phx.gbl...
John,

I could not come on the class either this morning, it is the
bindingmanagerbase and the me.bindingcontext.

Here you find some more infomration.

http://msdn2.microsoft.com/en-us/lib...ngcontext.aspx

Cor

"John Sheppard" <sp**@nospam.comschreef in bericht
news:fu********@news2.newsguy.com...
>Thanks cor...

There is no me.bindingmanager? Do you mean that I should be using the
bindingmanager component instead of a binding source?

I never have any luck with MSDN, I only ever seemed to find technical but
usless information there...always found google to be more useful...

Thank you
John

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:31**********************************@microso ft.com...
>>John,

You need the me.bindingmanager for this, however I could not find in a
reasonable way (I am at home now) good information about this on MSDN.
Maybe you can try it yourself.

Cor

"John Sheppard" <sp**@nospam.comschreef in bericht
news:fu*******@news2.newsguy.com...
Hello there,

I was wondering if anyone knew how to loop through all binding sources
on a form?

I tried the below code but the me.controls collection doesnt return
everything :(
For Each obj As Object In Me.Controls

If TypeOf (obj) Is BindingSource Then

MessageBox.Show(obj.name)

End If

Next

Thank you kindly for reading my message

John Sheppard



Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: david.jebo | last post by:
I have written this code and it executes well but I would like to instead of using multiple if statements write a loop that will do the exact same thing. Can anyone help me with writing a loop? ...
7
by: Ruslan Popov | last post by:
Hi, I am trying to prevent an assembly being loaded from GAC and instead want it loaded from the application's base directory. However, the assembly always gets loaded from GAC. How to have it...
0
by: popsovy | last post by:
Hi I have a question about whether Data Binding can facilitate the process of saving data in a web application I learned that you can data bind information from a number of different data...
4
by: emzyme20 | last post by:
Hi, I am trying to populate a list control that is bound to a data table but the display member needs to come from a different data table. I have two list controls in C#, one displaying...
2
by: Bob | last post by:
I have noticed that as one adds related tables to a bindingsource and dataset(vs2005 Vb.Net Sql Server 2005), the TODO and following code that fills the datasets on form load are written to the...
1
by: Bob Altman | last post by:
How do I bind a value from My.Settings to a property on a control on a Windows form? I've created a setting called My.Settings.Value1 of type String. Now I want to create a "Settings" dialog...
3
by: sekshin8 | last post by:
I am trying to bind fields from the first three records of a query (three records will always be returned by the query) to three textboxes on a windows form. ex. Textbox1.text = row1 column1...
3
by: Max | last post by:
Hello, I made a windows form with a combo box and 4 text boxes. All 5 objects should get their data from a data set which is populated in the form load method. The combo box has item ids. When...
4
by: Peter Duniho | last post by:
Okay, I'm hoping I'm missing something obvious here. Assume I've got a TextBox in my Form. I also have a string type user setting in the usual way (say, Settings.Default.MyText). Is there...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.