472,358 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Combo Box Update Problem

I have a combo box in which I've set the DataSource to an
instance of an ArrayList. The contents of the ArrayList
is managed in a timer control's timer_elapsed event
handler. The number of items in the ArrayList may
increase or decrease. When the contents of the ArrayList
changes, I try to update the choices in the combo box. I
can get the list to display correctly when items are
initially added to the ArrayList, but after that, I can't
change the list. I've tried a variety of things,
including the combo box's Update() and Refresh() methods.
Nothing I've tried works.
Can someone help me out?
Thanks in advance,
db_from _mn
Nov 15 '05 #1
2 5875
db_from_mn,

The reason this doesn't work is because the ArrayList doesn't implement
the IBindingList interface. This interface is used in data binding to allow
binders to know when the underlying list changes. In order to get around
this, you should create a class that either wraps the ArrayList, or
subclasses ArrayList and implements IBindingList. The ListChanged event on
the interface will let binders know that the list has changed.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"db_from_mn" <an*******@discussions.microsoft.com> wrote in message
news:76****************************@phx.gbl...
I have a combo box in which I've set the DataSource to an
instance of an ArrayList. The contents of the ArrayList
is managed in a timer control's timer_elapsed event
handler. The number of items in the ArrayList may
increase or decrease. When the contents of the ArrayList
changes, I try to update the choices in the combo box. I
can get the list to display correctly when items are
initially added to the ArrayList, but after that, I can't
change the list. I've tried a variety of things,
including the combo box's Update() and Refresh() methods.
Nothing I've tried works.
Can someone help me out?
Thanks in advance,
db_from _mn

Nov 15 '05 #2
Hi Nick,
Thanks for the help. I'll give it a try.
Dennis
-----Original Message-----
db_from_mn,

The reason this doesn't work is because the ArrayList doesn't implementthe IBindingList interface. This interface is used in data binding to allowbinders to know when the underlying list changes. In order to get aroundthis, you should create a class that either wraps the ArrayList, orsubclasses ArrayList and implements IBindingList. The ListChanged event onthe interface will let binders know that the list has changed.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"db_from_mn" <an*******@discussions.microsoft.com> wrote in messagenews:76****************************@phx.gbl...
I have a combo box in which I've set the DataSource to an instance of an ArrayList. The contents of the ArrayList
is managed in a timer control's timer_elapsed event
handler. The number of items in the ArrayList may
increase or decrease. When the contents of the ArrayList changes, I try to update the choices in the combo box. I can get the list to display correctly when items are
initially added to the ArrayList, but after that, I can't change the list. I've tried a variety of things,
including the combo box's Update() and Refresh() methods. Nothing I've tried works.
Can someone help me out?
Thanks in advance,
db_from _mn

.

Nov 15 '05 #3

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

Similar topics

1
by: Maria Joao | last post by:
I have two synchronized combo boxes and after the selection of the desired record, I need the user to open the related report, by pressing a button. My problem is that a combo box doesn't update...
1
by: JRT | last post by:
I have a continuous form with 3 comboxes, combo1, combo2 combo3. The choices in combo2 are dtermined the what is selected in combo1 by using a where = combo1 statement. The combo is refreshed...
3
by: mal | last post by:
Sorry for repost - system added to another subject for some reason Have tried numerous ideas from the group to solve this one. It is such a simple example that it should be straightforward ! I...
3
by: ILCSP | last post by:
Heello, I'm using Access 2000. I have a form with a combo box that has a query as its row source and it's bound to column 1. This combo box is unbound to a record like the rest of the form...
1
by: James | last post by:
I am used to VB6 but need to develop something in .Net. I need to create several bound combo-boxes which will use lookup tables to get their values. I created a form using the dataform wizard....
2
by: Ausclad | last post by:
How Would you implement this? I have an existing Access application that needs to be converted to .net I am restricted to use the existing database design. One of the areas is a timesheet...
5
by: debbie | last post by:
I have three combo boxes on a subform. I have tried setting them up so that when the user clicks in the combo box the curser moves to the left. I have searched the posts and can find nothing that...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
1
by: gdixon | last post by:
Greetings To All! I am using a Access 2003 and my programing skills are of the cut and paste variety. This means begining programming skills and on a good day perhaps middle of the road...
2
by: fredloh | last post by:
i have a table with a yes/no field call "Edited". i have a button that runs code to set the "Edited" field of a selected record to "yes". the code also set the rowsource (using SQL Update and Set...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.