|
-
Apr 21st, 2004, 12:26 PM
#1
Thread Starter
Lively Member
State ComboBox
I am trying to create a combobox for the user to select a US state. I have a table set up in SQL Server 2000 (tblStates) that has two fields: StateID (the two-character state code) and StateName (the full name of the state spelled out). The combobox is only wide enough to display the two-character state code. When the user clicks the dropdown, I want the list to show the full names of the states. But after selecting a state from the list, I want the combobox to only show the two-digit code (which is also the value member being stored in another table to which the control is bound). Problem is, if I select StateName as the display member, it shows the long state names in the dropdown, but it also shows the long name after a selection is made. Is there an easy way to do what I want using the default .NET combobox for Windows forms, or do I have to use a custom combobox? I've tried the ComponentOne combo, but I am having difficulty getting the search functionality to work (i.e. I want it so that if you press "T" once, Tennessee comes up, press "T" again and then Texas shows up, etc.)
Has anyone else solved this problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|