本文整理汇总了C#中DropDownList.ClearSelection方法的典型用法代码示例。如果您正苦于以下问题:C# DropDownList.ClearSelection方法的具体用法?C# DropDownList.ClearSelection怎么用?C# DropDownList.ClearSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DropDownList
的用法示例。
在下文中一共展示了DropDownList.ClearSelection方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SeleccionarItemCombo
public static void SeleccionarItemCombo(ref DropDownList combo, string valor, string texto)
{
combo.ClearSelection();
if ((combo.Items.FindByValue(valor) == null))
combo.Items.Insert(0, new ListItem(texto, valor));
combo.Items.FindByValue(valor).Selected = true;
}
示例2: seleccionaValorDelCombo
protected void seleccionaValorDelCombo(DropDownList cbx, String valueToSet)
{
cbx.ClearSelection();
ListItem li = cbx.Items.FindByValue(valueToSet);
if (li != null)
{
li.Selected = true;
}
}
示例3: LoadParentDropDown
private void LoadParentDropDown(DropDownList ddl, Category self)
{
// Load up the Parent DropDown
ddl.ClearSelection();
ddl.Items.Add(new ListItem("none", "0"));
foreach (Category cat in Category.Categories)
{
if (self == null || !cat.Id.Equals(self.Id))
ddl.Items.Add(new ListItem(cat.CompleteTitle(), cat.Id.ToString()));
}
}
示例4: SelectDropDownValue
public static void SelectDropDownValue(DropDownList ddl, string value)
{
if (value == "")
return;
ListItem li = ddl.Items.FindByValue(value);
if (li != null)
{
ddl.ClearSelection();
li.Selected = true;
}
}
示例5: setLocationFromFacebookLocation
private void setLocationFromFacebookLocation(DropDownList ddl, string loc_name)
{
ddl.ClearSelection();
foreach (ListItem item in ddl.Items)
{
if(item.Text.Equals(loc_name)){
item.Selected = true;
break;
}
}
}
示例6: DropDownList_SelectedValue
private void DropDownList_SelectedValue(ref DropDownList ddl, string value)
{
ddl.ClearSelection();
ListItem li = ddl.Items.FindByValue(value);
if (li != null) li.Selected = true;
}
示例7: LoadParentDropDown
private void LoadParentDropDown(DropDownList ddl)
{
// Load up the Parent DropDown
ddl.ClearSelection();
ddl.Items.Add(new ListItem("none", "0"));
foreach (Category cat in Category.Categories)
{
ddl.Items.Add(new ListItem(cat.CompleteTitle(), cat.Id.ToString()));
}
}