Select combobox item by valuemember value


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Select combobox item by valuemember value

  1. #1
    Join Date
    Jan 2004
    Location
    Alexandria, VA
    Posts
    392

    Select combobox item by valuemember value

    I am using a combobox to store values contained in a collection class, like so:

    lstKeywords.ValueMember = "KeywordID"
    lstKeywords.DisplayMember = "KeywordString"
    lstKeywords.DataSource = colKeywords

    I would like to programmatically select a certain combobox member at runtime via the "KeywordID" value. What's the simplest approach to do this?

    Thanks...
    Bob Rouse
    Dimension Data

  2. #2
    Join Date
    Dec 2004
    Posts
    163
    Bob,

    You can set the combo box's SelectedValue property to some value and the item with that value will be selected.

    Or am I not understanding what you are trying to do?

    Kerry Moorman

Similar Threads

  1. Replies: 5
    Last Post: 08-18-2006, 02:15 PM
  2. Getting a GUI to run
    By Eric in forum Java
    Replies: 4
    Last Post: 04-14-2006, 10:09 AM
  3. Getting a GUI to function
    By Eric in forum Java
    Replies: 1
    Last Post: 11-27-2001, 07:53 AM
  4. Get 10 months forward with select statment
    By Nirit Touboul in forum Database
    Replies: 7
    Last Post: 02-25-2001, 12:34 PM
  5. Stored Procedure (Want looping in Cursor)
    By malikmehmood in forum Database
    Replies: 0
    Last Post: 11-20-2000, 06:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center