Results 1 to 3 of 3

Thread: State ComboBox

  1. #1

    Thread Starter
    Lively Member Kenbuddy's Avatar
    Join Date
    Jul 2002
    Location
    Cypress, TX
    Posts
    96

    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?

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    My combobox implements type-ahead functionality. So if the user types 'T', they get Tennesse, but now if they type 'EX' also, it highlights Texas.

    My combobox rocks. Just had to share that with you. I also have a dropdowntree with typeahead. Man... its nice to have all that hard putzy work behind me... good luck to you, its still in front of you!

    Then again, my dropdown is for a web application, so meh.
    Attached Images Attached Images  

  3. #3

    Thread Starter
    Lively Member Kenbuddy's Avatar
    Join Date
    Jul 2002
    Location
    Cypress, TX
    Posts
    96
    Wow. Sounds great. Looks great. Maybe you could share some of your code with all the rest of us putzes?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width