howto append new list item in the aspx dropdownlist

this guide will tell you how to append new list item to the existing listitems in the aspx dropdown list.

1. make sure you activate the AppendDataBoundItems at the dropdownlist control, set the value to be true. AppendDataBoundItems=”true”

2. insert the following code in the code behin:
ddlObject.Items.Insert(0, new ListItem(”Default text”, “Default value”));

change the ddlObject name to your dropdownlist object name.

No Comments