Blog

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 exsting items in the DropDownList.


Share this post



Leave a comment


Previous Post

Next Post


\