Results 1 to 4 of 4

Thread: Return Combobox Value populated by array.

  1. #1

    Thread Starter
    Addicted Member skea's Avatar
    Join Date
    Mar 2006
    Posts
    187

    Return Combobox Value populated by array.

    Hello Folks, i would like to know how i can return the unseen value of a selected item from a combobox populated by an array.
    Last edited by skea; Apr 28th, 2006 at 12:52 AM.

  2. #2

    Thread Starter
    Addicted Member skea's Avatar
    Join Date
    Mar 2006
    Posts
    187

    Re: Return Combobox Value populated by array.

    Ok,Got It work.

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,430

    Re: Return Combobox Value populated by array.

    You should put your objects in an array or collection and assign that to the DataSource of the ComboBox. You then set the DisplayMember and ValueMember properties of the ComboBox to the names of the visible and hidden property respectively. Note that those properties are both type String, so you're assigning the name of the properties as strings, so you'll be assigning your DisplayItem and HiddenItem variables directly to those properties. When the user makes a selection the SelectedItem will be a ListItem object and the SelectedValue will be the ID property of that object. Note also that it's a good idea to set the DisplayMember and ValueMember before setting the DataSource for efficiency's sake.

  4. #4

    Thread Starter
    Addicted Member skea's Avatar
    Join Date
    Mar 2006
    Posts
    187

    Re: Return Combobox Value populated by array.

    Thanks. jmcilhinney.

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