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 (9)
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.
I’m thankful for the blog. Cool.
Appreciate you sharing, great blog. Much thanks again. Great.
Say, you got a nice blog post. Much thanks again. Will read on…
Wow, great blog article. Really thank you! Really Cool.
Great post. Really thank you! Really Cool.