本文整理汇总了C#中System.Web.UI.WebControls.RadioButtonList.ClearSelection方法的典型用法代码示例。如果您正苦于以下问题:C# RadioButtonList.ClearSelection方法的具体用法?C# RadioButtonList.ClearSelection怎么用?C# RadioButtonList.ClearSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.RadioButtonList
的用法示例。
在下文中一共展示了RadioButtonList.ClearSelection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectItem
/// <summary>
/// Selects and item in the radio button list control by the item value.
/// This is available as a property of the control in .Net 1.1
/// </summary>
/// <param name="control"></param>
/// <param name="value"></param>
public static void SelectItem(RadioButtonList control, string value)
{
control.ClearSelection();
ListItem item = control.Items.FindByValue(value);
if (item != null)
item.Selected = true;
}
示例2: SelectValueRadio
public void SelectValueRadio(RadioButtonList RadioButtonList, string value)
{
ListItem item = RadioButtonList.Items.FindByValue(value);
if (item != null)
{
RadioButtonList.ClearSelection();
item.Selected = true;
}
}
示例3: BindSearchConditionOperator
/// <summary>
/// Binds the search condition operator.
/// </summary>
/// <param name="saveSearchDoc">The save search doc.</param>
/// <param name="saveSearchName">Name of the save search.</param>
/// <param name="rdblSearchConditionList">The RDBL search condition list.</param>
protected void BindSearchConditionOperator(XmlDocument saveSearchDoc, string saveSearchName, RadioButtonList rdblSearchConditionList)
{
if(saveSearchDoc != null)
{
XmlNode xmlNodeSaveSearch = saveSearchDoc.SelectSingleNode("saveSearchRequests/saveSearchRequest[@name='" + saveSearchName + "']");
XmlNode xmlNodeOperator = null;
if(xmlNodeSaveSearch != null)
{
xmlNodeOperator = xmlNodeSaveSearch.SelectSingleNode("requestinfo/entity/attributegroup");
}
if(xmlNodeOperator != null && xmlNodeOperator.Attributes["operator"] != null)
{
if(rdblSearchConditionList.Items.FindByText(xmlNodeOperator.Attributes["operator"].Value) != null)
{
rdblSearchConditionList.ClearSelection();
rdblSearchConditionList.Items.FindByText(xmlNodeOperator.Attributes["operator"].Value).Selected = true;
}
else if(rdblSearchConditionList.Items.FindByValue(xmlNodeOperator.Attributes["operator"].Value) != null)
{
rdblSearchConditionList.ClearSelection();
rdblSearchConditionList.Items.FindByValue(xmlNodeOperator.Attributes["operator"].Value).Selected = true;
}
}
else
{
rdblSearchConditionList.SelectedIndex = 0;
}
}
}