SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Location
    England
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    binding a list<listitem> to drodownlist in detailsview

    Hi i have a detailsview where I want to dynamically create a listitems in dropdown list.

    i have added a databond

    protected void DisplayRecord_DataBound(object sender, EventArgs e)
    {
    DropDownList returnControl = (DropDownList)DisplayRecord.FindControl("ddlCategoryEdit");
    returnControl.Controls.Add(UserCategoryDetails.constructListFromDataBase());
    returnControl.DataBind();
    }
    }

    how would i bind a list of listitems to a datagrid in a detailsview or another way if possible.

    Thanks.
    Read my blog...
    Skylight Studios

  2. #2
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    returnControl.Items.Add(new ListItem(text, value));


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •