S
sck10
Hello,
I am using the following and am trying to figure out how to select the nth
item of a list in a DropDownList.
//Insert and Add items to the DropDownList
ddlPayStatus.Items.Insert(0, new ListItem("Non Selected", "Non
Selected"));
This selects the value "Non Selected"
ddlPayStatus.Items.FindByValue("Non Selected").Selected = true;
Select the nth item
ddlPayStatus.Items.IndexOf(0).Selected = true;
Thanks, sck10
I am using the following and am trying to figure out how to select the nth
item of a list in a DropDownList.
//Insert and Add items to the DropDownList
ddlPayStatus.Items.Insert(0, new ListItem("Non Selected", "Non
Selected"));
This selects the value "Non Selected"
ddlPayStatus.Items.FindByValue("Non Selected").Selected = true;
Select the nth item
ddlPayStatus.Items.IndexOf(0).Selected = true;
Thanks, sck10