Solved

ComboBox

Posted on 2006-11-13
2
376 Views
Last Modified: 2010-04-23
Good afternoon folks

I have a combobox that is populated by a table during the form load .....

I would like to be able to select a item in the combobox and based on criteria, have the item removed from the combobox. I do not want to re-populate the combobox due to the amout of data. I figure I can capture the combobox.selectedindex and remove the item based the index value but having little luck.

Thanks
0
Comment
Question by:stephenz43
2 Comments
 
LVL 6

Accepted Solution

by:
riyazthad earned 500 total points
ID: 17935038
I hope you are populating combox using dataset. In your ComboBox1_SelectedIndexChanged event, take value of selected item like ComboBox1.SelectedValue and based on value you need to repopulate  combo. Better to put binding in a sub or function.

Then u can reduce dataset using ds.Select("ProductID<>" & ComboBox1.SelectedValue)

If you are using DataView, you can use RowFilter method to reduce further and rebind.

I hope this will work out.

0
 

Author Comment

by:stephenz43
ID: 17935070
actually using a reader to populate the combobox....

This seems to work

cbobox.items.removeAt( someindexvalue)

I capture the selectedIndex in the SelectedIndexChanged event as you suggested

Seems to work pretty good

Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question