Click or drag to resize
KaxMenuItem Class
Represents an item in the KaxMenu control.
Represents a single item in the KaxMenu class.
Inheritance Hierarchy
SystemObject
  System.Web.UIControl
    System.Web.UI.WebControlsWebControl
      Kettic.AspNet.ControlsControlItem
        Kettic.AspNet.ControlsNavigationItem
          Kettic.AspNet.ControlsKaxMenuItem

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public class KaxMenuItem : NavigationItem, 
	ICloneable, IKaxMenuItemContainer

The KaxMenuItem type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleKaxMenuItem
Initializes a new instance of the KaxMenuItem class.
Public methodCode exampleKaxMenuItem(String)
Initializes a new instance of the KaxMenuItem class with the specified text data.
Public methodCode exampleKaxMenuItem(String, String)
Initializes a new instance of the KaxMenuItem class with the specified text and URL to navigate to.
Top
Methods
  NameDescription
Public methodClone
Creates a copy of the current KaxMenuItem object.
Public methodHighlightPath
Highlights the path from the item to the top of the menu.
Public methodRemove
Removes the item from its container
Top
Properties
  NameDescription
Public propertyCode exampleClickedCssClass
Gets or sets the Cascading Style Sheet (CSS) class applied when the menu item is clicked.
Public propertyCode exampleClickedImageUrl
Gets or sets the path to an image to display for the item when the user clicks the item.
Public propertyCode exampleDataItem
Gets or sets the data item represented by the item.
(Overrides ControlItemDataItem.)
Public propertyDisabledCssClass
Gets or sets the Cascading Style Sheet (CSS) class applied when the menu item is disabled.
Public propertyCode exampleDisabledImageUrl
Gets or sets the path to an image to display when the items is disabled.
Public propertyExpandedCssClass
Gets or sets the Cascading Style Sheet (CSS) class applied when the menu item is opened (its child items are visible).
Public propertyCode exampleExpandedImageUrl
Gets or sets the path to an image to display when the items is expanded.
Public propertyExpandMode
Gets or sets the expand behavior of the menu item. When set to ExpandMode.WebService the KaxMenuItem will populate its children from the web service specified by the KaxMenu.WebService and KaxMenu.WebServiceMethod properties.
Public propertyFocusedCssClass
Gets or sets the Cascading Style Sheet (CSS) class applied when the menu item is focused.
Public propertyGroupSettings
Specifies the settings for child item behavior.
Public propertyCode exampleHoveredImageUrl
Gets or sets the path to an image to display for the item when the user moves the mouse over the item.
(Overrides NavigationItemHoveredImageUrl.)
Public propertyCode exampleImageUrl
Gets or sets the path to an image to display for the item.
(Overrides NavigationItemImageUrl.)
Public propertyIsSeparator
Sets or gets whether the item is separator. It also represents a logical state of the item. Might be used in some applications for keyboard navigation to omit processing items that are marked as separators.
Public propertyCode exampleItems
Gets a KaxMenuItemCollection object that contains the child items of the current KaxMenuItem.
Public propertyCode exampleItemTemplate
Gets or sets the template for displaying the item.
Public propertyLevel
Manages the item level of a particular Item instance. This property allows easy implementation/separation of the menu items in levels.
Public propertyMenu
Gets the KaxMenu instance which contains the item.
Public propertyCode exampleNavigateUrl
Gets or sets the URL to link to when the item is clicked.
(Overrides NavigationItemNavigateUrl.)
Public propertyOuterCssClass
Gets or sets the Cascading Style Sheet (CSS) class applied on the outmost item element (<LI>).
Public propertyOwner
Gets the IKaxMenuItemContainer object which contains the current menu item.
Public propertyPostBack
Gets or sets a value indicating whether clicking on the item will postback.
Public propertySelected
Gets or sets a value indicating whether the item is selected.
Public propertySelectedCssClass
Gets or sets the Cascading Style Sheet (CSS) class applied when the item is selected.
Public propertySelectedImageUrl
Gets or sets a value specifying the URL of the image rendered when the item is selected.
Public propertyCode exampleTarget
Gets or sets the target window or frame to display the Web page content linked to when the menu item is clicked.
(Overrides NavigationItemTarget.)
Public propertyCode exampleText
Gets or sets the text caption for the menu item.
(Overrides ControlItemText.)
Public propertyValue
Gets or sets the value associated with the menu item.
(Overrides ControlItemValue.)
Top
Remarks

The KaxMenu control is made up of items. Items which are immediate children of the menu are root items. Items which are children of root items are child items.

An item usually stores data in two properties, the Text property and the Value property. The value of the Textproperty is displayed in the KaxMenu control, and the Value property is used to store additional data.

To create items, use one of the following methods:

  • Use declarative syntax to define items inline in your page or user control.
  • Use one of the constructors to dynamically create new instances of the KaxMenuItem class. These items can then be added to the Items collection of another item or menu.
  • Data bind the KaxMenu control to a data source.

When the user clicks an item, the KaxMenu control can navigate to a linked Web page, post back to the server or select that item. If the NavigateUrl property of an item is set, the KaxMenu control navigates to the linked page. By default, a linked page is displayed in the same window or frame. To display the linked content in a different window or frame, use the Target property.

Remarks

The KaxMenu control is made up of a hierarchy of menu items represented by KaxMenuItem objects. Menu items at the top level (level 0) that do not have a parent menu item are called root or top-level menu items. A menu item that has a parent menu item is called a submenu item. All root menu items are stored in the Items collection of the menu. Submenu items are stored in a parent menu item's Items collection. You can access a menu item's parent menu item by using the Owner property.

To create the menu items for a KaxMenu control, use one of the following methods:

  • Use declarative syntax to create static menu items.
  • Use a constructor to dynamically create new instances of the KaxMenuItem class. These KaxMenuItem objects can then be added to the Items collection of their owner.
  • Bind the Menu control to a data source.

When the user clicks a menu item, the Menu control can either navigate to a linked Web page or simply post back to the server. If the NavigateUrl property of a menu item is set, the KaxMenu control navigates to the linked page. By default, a linked page is displayed in the same window or frame as the KaxMenu control. To display the linked content in a different window or frame, use the Target property.

Each menu item has a Text and a Value property. The value of the Text property is displayed in the KaxMenu control, while the Value property is used to store any additional data about the menu item.

See Also