Posted: 10/27/2009
Hi,
How to add first option in dropdownlist after i have bind my dropdownlist with my datasource. ie
i have below code
Dropdownlist1.DataSource= mysource;
Dropdownlist1.Databind();
I want to insert an item with text "Please Select" and value=0
Follow the below link
http://www.codeasp.net/blogs/raghav_khunger/microsoft-net/556/how-to-add-item-to-dropdownlist-after-databind
Thanks,
Raghav
Here another article that you can refer:
Adding Default Select Option in the DroDownList
Posted: 10/28/2009
shawn said: I want to insert an item with text "Please Select" and value=0
Hi Shawn, You can insert text in dropdownlist in following two ways:
Dropdownlist1.Items.Insert(0, new ListItem("Please Select User Name", "0")); Dropdownlist1.Items.Add(new ListItem("Please Select User Name", "0"));