BlakeMcKenna
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!!!!!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?
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?
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?
ASKER
James,
I fill the comboboxes with a string value via a dataset. The DisplayMember contains a string and the ValueMember contains an integer.
I fill the comboboxes with a string value via a dataset. The DisplayMember contains a string and the ValueMember contains an integer.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks James...
Aren't you lokoking for
ComboBox.SelectionChangeCo
Regards