Bound dropdownlist inside DetailsView control not displaying ListItem added via Insert()

Discussion in 'ASP .Net' started by donet programmer, Oct 25, 2007.

  1. The dropdown list is created inside the EditItemTemplate of the
    DetailsView control. I am binding a dropdownlist to a dataset
    programatically when the user switches to the Edit mode. In the code
    after the binding the dropdown to the dataset, I insert a listitem at
    index 0, something like this :

    MyDDL.Items.Insert(0, new ListItem("-Select-", "-1"));

    When I run the code and change to Edit a record, I only see data bound
    items in the dropdown. This works great if I move the dropdown outside
    the DetailsView.

    I know there are ways to get around this, just wondering if this is a
    bug in .NET 2.0?? One would expect controls to be working the same way
    whether inside or outside a DetailsView, GridView controls
    donet programmer, Oct 25, 2007
    #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. Mad Scientist Jr
    Replies:
    2
    Views:
    437
    Mad Scientist Jr
    Jun 29, 2004
  2. Mario Krsnic
    Replies:
    0
    Views:
    377
    Mario Krsnic
    Jun 23, 2006
  3. cannontrodder
    Replies:
    1
    Views:
    721
    cannontrodder
    Jul 25, 2006
  4. Jim in Arizona
    Replies:
    7
    Views:
    911
    Badass Scotsman
    Nov 22, 2006
  5. Feege
    Replies:
    0
    Views:
    448
    Feege
    Dec 20, 2005
Loading...

Share This Page