SelectItem

/// <summary>
/// Select a item in a DropDownList by informed value.
/// </summary>
/// <param name="ddl">DropDownList object.</param>
/// <param name="value">Value to be selected.</param>
public static void SelectItem(this DropDownList ddl, string value)
{
	if (ddl.Items.FindByValue(value) != null)
		ddl.Items.FindByValue(value).Selected = true;
}
Example:
cbo.SelectItem("1");

Description

Select a item in a DropDownList by value.

Details

Double click on the code to select all.

 

;