DropDownList Control Examples:
You can see the live samples and examples of DropDownList Control from the following links:- Setting DropDownList Default Value
- DropDownList Control SelectedValue Property
- DropDownList Control SelectedIndex Property
- DropDownList Control JavaScript Validation
- Populate DropDownList Items Dynamically
Example 1:
DropDownList1.SelectedIndex =
DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText("Confections"));
Example 2:
DropDownList1.SelectedIndex =
DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue("3"));
Example 3:
DropDownList1.Items.FindByValue("4").Selected
= true;
<asp:DropDownList ID="ddlLanguage"
runat="server"
Style="width:
200px">
asp:DropDownList>
ddlLanguage.SelectedIndex =
ddlLanguage.Items.IndexOf(ddlLanguage.Items.FindByText("English"));
No comments :
Post a Comment