protected internal override void ChangeItemSelectState(ListItemTester item, bool selected) { if (SelectionMode == ListSelectionMode.Single) { SetListSelection(item, selected); } else { ToggleItemSelection(item, selected); } }
protected void ToggleItemSelection(ListItemTester item, bool selected) { if (selected) { EnterInputValue(item.Element, Tag.Attribute("name"), item.Value); } else { RemoveInputValue(item.Element, Tag.Attribute("name")); } OptionalPostBack(Tag.OptionalAttribute("onchange")); }
protected void SetListSelection(ListItemTester item, bool selected) { string name = Tag.Attribute("name"); foreach (XmlElement option in OptionList) { RemoveInputValue(option, name); } if (selected) { EnterInputValue(item.Element, name, item.Value); } OptionalPostBack(Tag.OptionalAttribute("onchange")); }
protected internal virtual void ChangeItemSelectState(ListItemTester item, bool selected) { SetListSelection(item, selected); }
/// <summary> /// Determines whether the collection contains the specified item. /// </summary> /// <param name="item">A System.Web.UI.WebControls.ListItem to search for in the collection.</param> /// <returns>true if the collection contains the specified item; otherwise, false.</returns> public bool Contains(ListItemTester item) { return(InnerList.Contains(item)); }