Friday, July 18, 2008

Selecting an item in an asp.net dropdownlist programmatically

myDropDownList.SelectedIndex = myDropDownList.Items.IndexOf(myDropDownList.Items.FindByValue(value))

It might even be easier to do this...

myDropDownList.Items.FindByValue(value).Selected = True

No comments: