Thursday, July 26, 2012

“DropDownList.SelectedIndex = -1” problem

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

No comments:

Post a Comment

If you have any doubts, please let me know

PARASHURAMA JAYANTI 2020

In year 2020, Parashurama Jayanti will Celebrate on Saturday, 25th April 2020. Parashurama Jayanti Muhurat : Parashurama J...