Posts Tagged ‘selected’

cannot have multiple items selected in a dropdownlist

This error occurs when you set the Selected property of the dropdownlist control and there’s already selected item , example.

dropdownlist.Items.FindByValue(“value”).selected = True

or

dim lst as listitem

lst = dropdownlist.Items.FindByText(“textvalue”)

lst.selected = True

To solve this problem, before you call the above code you need to clear the selection in the dropdownlist.

To clear the selection

dropdownlist.ClearSelection();

, ,

No Comments



SetPageWidth