Binding asp:DropDownList on asp:Repeater

Discussion in 'ASP .Net' started by Goncalo Faria, Dec 2, 2003.

  1. Hi.

    I'll go directly to my problem:

    I have a repeater that is binded with data.

    For each data row I want the user to be able to change a
    field, that is represented by a DropDownList.

    My problem is that when binding the DropDownList I am not
    able to select a default item that is at an index != 0
    (zero).

    Here is the code when binding the dropdown:

    _dropdown.DataSource = _dataTable
    _dropdown.DataTextField = "myTextField"
    _dropdown.DataValueField = "myValueField"
    _dropdown.DataBind()

    _dropdown.Items.FindByValue(_myValue).Selected = True

    these instructions are called in an overload method that
    is triggered everytime a repeater item is created.

    Any ideas?
    If you want me to be more specific, pleas reply...

    thank's in advance
    goncalo
    Goncalo Faria, Dec 2, 2003
    #1
    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. Jordan
    Replies:
    2
    Views:
    2,513
    Jordan
    Feb 10, 2004
  2. mrwoopey
    Replies:
    0
    Views:
    2,192
    mrwoopey
    Apr 15, 2004
  3. Amit
    Replies:
    6
    Views:
    13,739
    Assimalyst
    Oct 24, 2006
  4. Replies:
    2
    Views:
    838
    Kevin Grover
    Oct 20, 2006
  5. JcFx
    Replies:
    0
    Views:
    263
Loading...

Share This Page