Please try below syntax:
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue("Select"))
or
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText("SelectText"))
or
DropDownList1.Items.FindByText("Select").selected =true
you can refer solution at :
http://stackoverflow.com/questions/81214/dropdownlist-selectedindex-1-problem/11666108#11666108
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue("Select"))
or
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText("SelectText"))
or
DropDownList1.Items.FindByText("Select").selected =true
you can refer solution at :
http://stackoverflow.com/questions/81214/dropdownlist-selectedindex-1-problem/11666108#11666108
No comments:
Post a Comment
If you have any doubts, please let me know