473,947 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bindinglist(of T) bound to two controls

VS.net 2005

I'm using a bindinglist(of T) to bind to various controls on a WinForm. I
use the name/value pairs in the "type" for the displayMember and ValueMember
of say a ComboBox control.

For example I might load the TermsNumber and TermsDescriptio n from a
database into the binding list and then use the combobox to feed into a
customer setup form for default terms and for a order setup form for the
individual order terms.

I haven't checked this when the binding list is bound to two different forms
in the same project, however when they I have two comboboxes bound to the
same bindinglist on the same form they always resynch when one is changed.

I want them to act independently. Is this possible? I set the
RaiseLastChange Event = False, but this has no effect.

I realize I can create two bindinglists and use them separately, but this
seems like a waste of memory if I could decouple the bindinglist synch.

Any suggestions?

Rick
Mar 10 '07 #1
1 1837
I recommend that you add 2 binding sources, one for each table, and bind
both of these to one bindinglist. The binding source is a component in the
Data part of the Toolbox, or you can create it programmaticall y.

Dim myBindingSource as BindingSource = New BindingSource()
Dim myOtherBindingS ource as BindingSource = New BindingSource()

myBindingSource .DataSource = myBindingList
myOtherBindingS ource.DataSourc e = myBindingList

myComboBox.Data Source = myBindingSource
(valuemember, displaymember)

myOtherComboBox .DataSource = myOtherBindingS ource
(value member, display member)

Robin S.
-----------------------------------
"Rick" <Ri**@LakeValle ySeed.comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
VS.net 2005

I'm using a bindinglist(of T) to bind to various controls on a WinForm.
I use the name/value pairs in the "type" for the displayMember and
ValueMember of say a ComboBox control.

For example I might load the TermsNumber and TermsDescriptio n from a
database into the binding list and then use the combobox to feed into a
customer setup form for default terms and for a order setup form for the
individual order terms.

I haven't checked this when the binding list is bound to two different
forms in the same project, however when they I have two comboboxes bound
to the same bindinglist on the same form they always resynch when one is
changed.

I want them to act independently. Is this possible? I set the
RaiseLastChange Event = False, but this has no effect.

I realize I can create two bindinglists and use them separately, but this
seems like a waste of memory if I could decouple the bindinglist synch.

Any suggestions?

Rick

Mar 10 '07 #2

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

Similar topics

3
4879
by: guy | last post by:
VB2005 a generic collection that inherits from BindingList, with the code to support sorting added (ApplySortCore, SpportsSortingCore etc.) however when this collection is populated and bound to a DataGridView ApplySortCore is not called when a grid header is clicked. how do i ensure this happens?
3
3921
by: Monty | last post by:
I've created an object (called cMyBindingList) that inherits from BindingList. I can serialize it and it's child items with no problem. However, I've also created a public variable in cMyBindingList that I set when I first create it. This variable, even though it is public, does not serialize to the XML. What is the reason for this? Is it possible to do it? TIA for any light you can shed. Here's the sample code (from a form with a single...
1
1514
by: Pieter | last post by:
Hi, I use a customized Generic List (VB.NET 2.0) inherited from BindingList(Of T). I made some methods in this BindingList, to allow me to do some standard functions on the BindingList-Items. One of them is for instance SumItems, which returns me the sum of a given Property of all the Items in the List.
6
16854
by: jwilson128 | last post by:
I am trying to decide whether to use a system.ComponentModel.BindingList(of T) or a Sytem.Collections.Generic.List(of T) for a custom collection. In testing a simple, read-only data binding to a data grid view - they both work. Are there aspects of databinding that the regular list will not support and vice-versa, is there any reason to choose a regular list over the bindinglist? -Jeff
10
1658
by: Rick | last post by:
VS 2005 I have a class of BindingList(of T) to use as a datasource for a lookup combobox. The combobox is to lookup the Terms for a Purchase Order. When I implement this on my Winform, the combobox does not synch with the underlying data, i.e. the Terms description does not show for the terms number. The combobox does show the Descriptions in the drop-down box, so they are
1
5117
by: =?Utf-8?B?RWl0YW4=?= | last post by:
Hello, I have a ComboBox named comboBoxSelChannel. I declared a structure named MySturct. public struct MyStruct { public int Index; public string Name;
2
4762
by: Pieter | last post by:
Hi, Im' using a custom list Inherited from BindingList(Of T). I would like to add a Filter to be able to filter on different column values. Offcourse this must exist already, and after some google-search I found 2 nice implementations: - http://sourceforge.net/projects/blw/ - http://www.teamjohnston.net/cs/blogs/jesse/Default.aspx#ae1af67f6-fe7a-4567-9d1a-ce75000aa327
4
26499
by: jehugaleahsa | last post by:
Hello: I want to know the best way to sort a BindingList without needed to turn it into a DataTable. Of course, my BindingList is being used indirectly by a BindingSource. So, how do I sort a BindingList of my custom business objects? For instance, when the user clicks on a column header of a DataGridView, I would like sorting to be handled for me (or to call a custom sort method I provide).
2
5742
by: Ste | last post by:
Good morning, I have a bindinglist of my custom objects and need to check, before adding items, if an item exists in list and then cancel inserting. I have tried to create an object that inherits from bindinglist<mycustomobjectbut I cannot override Add method. This because this bindinglist is a datasource for a datagrid and need to avoid to insert duplicated instances.
0
10162
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9982
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11573
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11156
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11346
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10690
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9886
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7429
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6113
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.