TwitterLinkedInBlog

Thursday, September 29, 2011

.NET - Select a ListItem

sampleDropDownList.ClearSelection();
ListItem sampleListItem = sampleDropDownList.Items.FindByValue(sampleValue);
if (sampleListItem != null)
{
    sampleListItem.Selected = true;
}

No comments: