Drop down list selected index

Discussion in 'ASP .Net' started by J. Babe, Aug 5, 2003.

  1. J. Babe

    J. Babe Guest

    I am populating a drop down list with a privilege levels from a table
    called "Privilege" with the fields "PrivilegeID" and "PrivilegeName".
    In a table named "Users", their is a corresponding column
    "PrivilegeID" that has a value from the "PrivilegeID" field in the
    "Privilege" table.
    First I populate the drop down with all the records in "Privilege"
    table, setting the .DataValueField property to the "PrivilegeID", then
    I want to set the selected index of the dropdown to match the value of
    the "PrivilegeID" in the "Users" table. I am wondering what the
    easiest way to do this is (or any way that works).
    J. Babe, Aug 5, 2003
    #1
    1. Advertising

  2. myddl.Items.FindByValue(iPrivilegeID).Selected = True

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "J. Babe" <> wrote in message
    news:...
    > I am populating a drop down list with a privilege levels from a table
    > called "Privilege" with the fields "PrivilegeID" and "PrivilegeName".
    > In a table named "Users", their is a corresponding column
    > "PrivilegeID" that has a value from the "PrivilegeID" field in the
    > "Privilege" table.
    > First I populate the drop down with all the records in "Privilege"
    > table, setting the .DataValueField property to the "PrivilegeID", then
    > I want to set the selected index of the dropdown to match the value of
    > the "PrivilegeID" in the "Users" table. I am wondering what the
    > easiest way to do this is (or any way that works).
    Steve C. Orr, MCSD, Aug 5, 2003
    #2
    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. Anthony Judd

    Drop Down List Selected Index!!!

    Anthony Judd, Nov 1, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    405
    =?Utf-8?B?c3Jpbmk=?=
    Nov 1, 2004
  2. Replies:
    0
    Views:
    4,853
  3. DCC700
    Replies:
    0
    Views:
    935
    DCC700
    Jul 14, 2006
  4. weiwei
    Replies:
    0
    Views:
    996
    weiwei
    Jan 5, 2007
  5. Replies:
    0
    Views:
    160
Loading...

Share This Page