Solved

ComboBox

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

20 Experts available now in Live!

Get 1:1 Help Now