DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue("Mahesh"))
veya
Seçenekler içinde dolaşarak seçme:
Private Function SelectCurrentQuarterAndYear(ByVal stringToSelect As String)
DropDownList1.ClearSelection()
For Each item As ListItem In DropDownList1.Items
If item.Text = stringToSelect Then
item.Selected = True
Exit For
End If
Next
End Function
DropDownList1.ClearSelection()
For Each item As ListItem In DropDownList1.Items
If item.Text = stringToSelect Then
item.Selected = True
Exit For
End If
Next
End Function
Kaynak:
Hiç yorum yok:
Yorum Gönder