Add static item to DropDownList web control after data bind in ASP.NET
Sometimes we need to add a static item to the top of DropDownList web control, such as “– Please select –” or any other text. This static item will be removed and replaced with the items that comes from the data source you are using after calling DataBind() method.
To keep the static item you are going to need to set the “AppendDataBoundItems” property of the DropDownList to “True”.
This will keep all your static items and instead of remove and replace the items that comes from the data source you are using it will append to the existing items in the DropDownList.
Comments (4)
gededa de thanks ya bahsa
Thnx man..!!!
thanks dude. You’ve saved my hair 🙂
There is certainly a lot to learn about this subject. I like all of the points you have made.