Posted: 10/27/2009 12:06:24 PM
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
Posted: 10/27/2009 12:38:03 PM
Follow the below link
http://www.codeasp.net/blogs/raghav_khunger/microsoft-net/556/how-to-add-item-to-dropdownlist-after-databind
Thanks,
Raghav
Posted: 10/27/2009 9:06:47 PM
Here another article that you can refer:
Adding Default Select Option in the DroDownList
Posted: 10/28/2009 12:47:46 AM
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"));