-
SitePoint Enthusiast
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.
-
returnControl.Items.Add(new ListItem(text, value));
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks