473,513 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple comboBox one array datasource. help...


I have an array of a custom obj which I am trying
to use in multiple comboBoxes without creating multiple
copies, but if I put the datasource of the comboboxes to
the same array, then at runtime if I pick change a combobox,
all of them change to that value. I am guessing that it is
because all the comboboxes are using the same Ilist interface,
and the behind-the-sceens variables.

Now, I could create my own wrapper class to wrap the
array, but I was hoping that there was already one hiding
in plan sight in the frameworks.

Thanks in advance for all help on the issue.
Feb 16 '06 #1
1 2755
Hi,

"TheMadHatter" <Th**********@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...

I have an array of a custom obj which I am trying
to use in multiple comboBoxes without creating multiple
copies, but if I put the datasource of the comboboxes to
the same array, then at runtime if I pick change a combobox,
all of them change to that value. I am guessing that it is
because all the comboboxes are using the same Ilist interface,
and the behind-the-sceens variables.

Now, I could create my own wrapper class to wrap the
array, but I was hoping that there was already one hiding
in plan sight in the frameworks.

If the two ComboBoxes SelectedValue isn't bound to a common table, list or
object then you can set a different BindingContext for each ComboBox:

comboBox1.BindingContext = new BindingContext();
comboBox2.BindingContext = new BindingContext();

But you could also use a wrapper (like you mentioned). I don't think there
anyhing available in NET1.1, but you could create one yourself (eg. based on
IListSource to keep it simple).

In NET2.0 you just put a different BindingSource between the List and the
ComboBox.

HTH,
Greetings

Thanks in advance for all help on the issue.

Feb 16 '06 #2

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

Similar topics

7
20751
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well....
2
1878
by: Bob | last post by:
I have an ArryList that I'm using as a datasource for a combobox. As an item is selected in the combobox and processed I'd like to remove it from the combobox. When I try I get an error stating...
9
3980
by: Bob | last post by:
I want to remove the item from the combobox, but can't because I can't remove the ArrayList as being the datasource of the combobox so I can remove the item in the ArrayList and then assign it back...
1
1398
by: Bob | last post by:
I have an arraylist (arlNAMES) that is bing used as a datasource for a combobox. When an item is selected in the combobox I want to remove it from both the combobox and the arraylist. This...
0
1115
by: Richard | last post by:
I have a combobox that I use to display the advertising medium that attracted a client. On the Client's table is the foreign key AdvertisingMedium, and the combobox successfully reads the data...
2
12495
by: AMDRIT | last post by:
Hello Everyone, I would like to format the Display Members of a combobox's datasource. Is there a way to apply a format without subclassing the original datasource? For example, given a list of...
5
3170
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as...
4
28218
by: polaris431 | last post by:
All the examples I've seen showing how to populate a combobox using the DataSource property and an ArrayList show the ArrayList object containing objects with at least two properties. I want to...
2
11437
by: Matt | last post by:
Hi all, me again! :) I've now got an issue with combo boxes. Basically, I have a number of items that I want a user to pick from a single list. It's basically along the lines of: Fruit 1: ...
0
7161
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
7384
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
7525
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
5686
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,...
1
5089
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
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...
0
3234
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...
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.