Solved

ComboBox

Posted on 2006-11-13
2
374 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now