Results 1 to 7 of 7

Thread: dropdownlist question *[RESOLVED]*

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306

    Question dropdownlist question *[RESOLVED]*

    i have a question for you .netters out there. i am using a dropdownlist on a webform and loading the values from a database. works fine.

    what i want to do is jump to an item in the list by using the "findbyvalue" function. e.g:

    Code:
    ddlCountys.Items.FindByValue(rs("CountyID").ToString()).Selected = True
    this failed. i was told something along the lines of "an item is already selected so u cant do that"

    i resolved this by using "ddl.selecteditem.selected = false", the result being:

    Code:
    ddlCountys.SelectedItem.Selected = False
    ddlCountys.Items.FindByValue(rs("CountyID").ToString()).Selected = True
    there is something about having to do that which irritates me, i dont want two lines of code

    whats a better way please?
    Last edited by tailz; Jun 18th, 2003 at 02:47 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
  •  



Click Here to Expand Forum to Full Width