DropDownList - Preselected.

Discussion in 'ASP .Net' started by Adam Knight, Sep 8, 2005.

  1. Adam Knight

    Adam Knight Guest

    Hi all,

    What is the best way to preselect a drop down list item based on info from a
    db?

    Surely i don't have to write a function iterating through all the list items
    and comparing values to find the required index???

    Cheers,
    Adam
    Adam Knight, Sep 8, 2005
    #1
    1. Advertising

  2. Adam Knight

    Onin Tayson Guest

    set the dropdown's SelectedValue to the value from your table.

    "Adam Knight" <> wrote in message
    news:%...
    > Hi all,
    >
    > What is the best way to preselect a drop down list item based on info from
    > a db?
    >
    > Surely i don't have to write a function iterating through all the list
    > items and comparing values to find the required index???
    >
    > Cheers,
    > Adam
    >
    Onin Tayson, Sep 8, 2005
    #2
    1. Advertising

  3. Adam Knight

    Adam Knight Guest

    Excellent!

    "Adam Knight" <> wrote in message
    news:%...
    > Hi all,
    >
    > What is the best way to preselect a drop down list item based on info from
    > a db?
    >
    > Surely i don't have to write a function iterating through all the list
    > items and comparing values to find the required index???
    >
    > Cheers,
    > Adam
    >
    Adam Knight, Sep 8, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,575
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,199
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,842
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  4. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,276
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. weiwei
    Replies:
    0
    Views:
    991
    weiwei
    Jan 5, 2007
Loading...

Share This Page