Thanks
BriegaYes, there is another way. After the call to DataBind, given a listbox called lb:
lb.Items.Insert(0,"--Choose the Value--")
There is another overload of Items.Insert that will allow you to insert an item with a specified text and value, if that is required.
Hello,
sure there are another ways. You can insert a new row in a listbox or of course a dropdownlistbox with the methodsInsert orAdd like in the following examples:
myListbox.Items.Insert(0, New ListItem("NewText", "0"))where the first parameter of ListItem is the text which appears and the second parameter is the value. In this case the 0 indicates that the item will be insert at the first postion. With theAdd-Method it is just possible to append items like in the following example:myListbox.Items.Add("NewText")HTH,The sample inlink is for Dropdownlist
Changing it to listbox will do the work
0 comments:
Post a Comment