Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ComboBox

Posted on 2006-11-13
2
Medium Priority
?
394 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses

916 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