473,666 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating ComboBox DataSource

Bob
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 doesn't work. DOes anyone know
why and how to fix it?

Dim intPOS As Integer = cboAdvanceRespo nse.SelectedInd ex
cboAdvanceRespo nse.DataSource = Nothing
arlNAMES.Remove At(intPOS)
arlnames.TrimTo Size
arlREF.RemoveAt (intPOS)
cboAdvanceRespo nse.DataSource = arlNAMES

Nov 21 '05 #1
1 1410
If it is bound to the Array, you only have to remove it from the array and
it should remove itself from the ComboBox.

If removing it from the array does not remove it from the combobox, then you
need to have set up public events to update the combobox

OHM
"Bob" <Bo*@discussion s.microsoft.com > wrote in message
news:43******** *************** ***********@mic rosoft.com...
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 doesn't work. DOes anyone know
why and how to fix it?

Dim intPOS As Integer = cboAdvanceRespo nse.SelectedInd ex
cboAdvanceRespo nse.DataSource = Nothing
arlNAMES.Remove At(intPOS)
arlnames.TrimTo Size
arlREF.RemoveAt (intPOS)
cboAdvanceRespo nse.DataSource = arlNAMES

Nov 21 '05 #2

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

Similar topics

0
1497
by: CalPARK InterNetStation | last post by:
Could anyone explain why the difference of behavior betweein Case1 and Case2 occurs? Microsoft Visual C#.NET 55607-652-0000007-18218 Windows Forms Application 1. put a TabControl on a Form and make a few TabPages 2. put a ComboBox on the one of them 3. run this code and move to the TabPages where the ComboBox sits 4. select some item of the ComboBox and move to the other TabPage
3
3024
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can download a fully working C# sample with the Northwind.mdb here: www.insightgis.com.au/web/stuff/DataGridCombo.zip
2
4326
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know how to use this code? please help! http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20862953.html
8
1970
by: Steve B. | last post by:
My Program: a local C# ADO.Net application using VS 2003 Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection, DataAdapter and DataSet datasource. Each CB has it's own DA and DS. When I tried to use the same DS as the datadource for each of the five CB's, changing one of the CB's selection affectd the other four CB's. New business requirements require I...
2
1887
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 that the arraylist is being used as a datasource and can't be updated. I can't remove it as the datasource for the combobox so I can update it and reassign it back as the datasource. Anyone got a workaround?
3
1831
by: Grant | last post by:
I need some sample code showing how to manipulate data in my access database using C#. This is what Im trying to do: Dropdownlist with datagrid both bound to datasource. When the drop down list value changes - the datagrid values change accordingly. I managed to get this working by setting the currencymanager to the dropdownlist selectedIndex (which is probably the wrong way to do it, bu the datagrid seems to update its values correctly)...
6
2874
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
2
15584
by: samueltilden | last post by:
This problem should be simple. I am using Visual Studio 2003, Version 1.1 I am writing a desktop application in which I am binding a DataTable to the DataSource of a ComboBox. // I have 50 rows (concerning states) in dataTable.Rows;
2
3309
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the CurrentChanged event of the BindingSource of the combobox to update the textbox. When selecting an item in the combobox or when selecting a row in the grid, it is updating the textbox correctly. The problem is when I apply a filter in the grid, and then...
0
8448
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
8871
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
8783
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
8552
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
8640
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
7387
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...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
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.