Link to home
Start Free TrialLog in
Avatar of BlakeMcKenna
BlakeMcKennaFlag for United States of America

asked on

Having trouble with comboboxes?

This is bugging me. My problem is that I'm obviously not sure what events to use for a ComboBox. I know the SelectedIndexChanged event is the default event but it seems to fire whenever the value in the ComboBox changes. I understand that but are there any events that you can use that will allow you to select a value from the DropDownList and not have any other events fire. This is becoming a mountain instead of a molehill!!!!!
Avatar of Rgonzo1971
Rgonzo1971

Hi,

Aren't you lokoking for

ComboBox.SelectionChangeCommitted

Regards
Avatar of BlakeMcKenna

ASKER

What property do I check for then to validate the selection? Once I've selected an item, I then do an edit check and I've tried SelectedItem, SelectedText, Text and they're all blank...
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
James,

This information was very helpful. One more question though. What event and property would be the best to use as soon as a value is selected from the DropDownList?
If the values are unique (the same value does not appear twice), then SelectedIndexChanged is the best one to use.

As for the property to use to read the value, it depends on the type of objects that are used to fill the list and what you want to retrieve in that object. What type of object do you use to fill the list: strings, collection, other?
James,

I fill the comboboxes with a string value via a dataset. The DisplayMember contains a string and the ValueMember contains an integer.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks James...