Friday, 29 June 2012

Adding Item to DataBound Drop Down List


            DropdownList.DataSource = Assgn Source;    EX: datatable or dataset or list values
             DropdownList .DataTextField = "Test To Display in ui page";
             DropdownList .DataValueField = "id";
             DropdownList .DataBind();
             DropdownList .Items.Insert(0, new ListItem("--All---", "0"));

No comments:

Post a Comment