System.Web.UI.WebControls.MenuItemBindingCollection Class

Represents a collection of System.Web.UI.WebControls.MenuItemBinding objects.

See Also: MenuItemBindingCollection Members

Syntax

public sealed class MenuItemBindingCollection : System.Web.UI.StateManagedCollection

Remarks

The System.Web.UI.WebControls.MenuItemBindingCollection class is used to store and manage a collection of System.Web.UI.WebControls.MenuItemBinding objects in the System.Web.UI.WebControls.Menu control. The System.Web.UI.WebControls.Menu control uses the System.Web.UI.WebControls.MenuItemBindingCollection class as the data type for its Menu.DataBindings property. The Menu.DataBindings property is used to store any menu item bindings defined for the System.Web.UI.WebControls.Menu control.

Note:

The order in which System.Web.UI.WebControls.MenuItemBinding objects appear in the collection has no effect on how those objects are applied to the menu items in a System.Web.UI.WebControls.Menu control.

The System.Web.UI.WebControls.MenuItemBindingCollection class supports several ways to access the items in the collection:

You can programmatically manage a System.Web.UI.WebControls.MenuItemBindingCollection object by adding and removing System.Web.UI.WebControls.MenuItemBinding objects. To add menu items to the collection, use the MenuItemBindingCollection.Add(MenuItemBinding) or the MenuItemBindingCollection.Insert(int, MenuItemBinding) method. To remove nodes from the collection, use the MenuItemBindingCollection.Remove(MenuItemBinding), the MenuItemBindingCollection.RemoveAt(int), or the System.Web.UI.StateManagedCollection.Clear method.

The System.Web.UI.WebControls.MenuItemBindingCollection class contains properties and methods that allow you to retrieve information about the collection itself. To find out how many items are in the collection, use the System.Web.UI.StateManagedCollection.Count property. If you want to determine whether the collection contains a certain System.Web.UI.WebControls.MenuItemBinding object, use the MenuItemBindingCollection.Contains(MenuItemBinding) method. To get the index of a System.Web.UI.WebControls.MenuItemBinding object in the collection, use the MenuItemBindingCollection.IndexOf(MenuItemBinding) method.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0