RadMenu for ASP.NET

The RadMenu client object Send comments on this topic.
See Also
Telerik RadMenu client-side > The RadMenu client object

Glossary Item Box

Methods 

Name

Parameters

Return Type

Description

Disable none none Disables all items in the menu. Clicking on any item has no effect, child items cannot be opened.
Enable none none Enables all items in the menu.
Close none none

Closes all opened items

Show (browserEvent) none Shows a context menu at the coordinates specified in the browser event.
ShowAt (int x, int y) none Shows a context menu at the specified coordinates.
FindItemByUrl (string URL) RadMenuItem Returns the first RadMenuItem object whose NavigateUrl property is equal to the passed parameter.
Note: The NavigateUrl property is transformed to absolute URL on the client-side, e.g. "default.aspx" is turned into: http://mydomain.com/default.aspx.
SetContextElementID (string elementID) none Binds a context menu to the html element with the specified ID. The context menu will open only when right-clicking on the element.
SetAttribute (sting attributeName, string value)  none Sets the value of the specified custom attribute.
GetAttribute (sting attributeName)  string Returns the value of the specified custom attribute. If there is no such attribute, null is returned.  
FindItemByValue (string value) RadMenuItem Returns the first RadMenuItem object whose Value property is equal to the passed parameter.
FindItemByText (string text) RadMenuItem Returns the first RadMenuItem object whose Text property is equal to the passed parameter.
FindItemById (string text) RadMenuItem Returns the first RadMenuItem object whose ID property is equal to the passed parameter.
AttachEvent (string eventName, mixed eventHandler) none Attaches an eventHandler to the specified eventName.
For more information, check Client-side API in this help.
DetachEvent (string eventName, mixed eventHandler) Boolean

Detaches an eventHandler from the specified eventName.
Returns "True" if an eventHandler hooked to the specified eventName is found and detached, false otherwise.
For more information, check Client-side API in this help.

MouseEventX ( browserEvent) integer Returns the x-coordinate of the current browser event.
MouseEventY ( browserEvent) integer Returns the y-coordinate of the current browser event.
Hide none none Hides the menu if it is context (IsContext="True")
EnableEvents none none

Enables the control client-side event emitting. Events are enabled by default.

Focus none none Brings the focus to the menu so that it can be controlled via the keyboard.
DisableEvents none none

Disables the control client-side event emitting.

Properties

Name

Type Description
ID String

Gets the ClientID of the control.

Example Copy Code
<script type="text/javascript">
   
var menu1 = <%=RadMenu1.ClientID %>
   
function showMenu()
   {
       
alert(menu1.ID);
   }
   
showMenu();
</script>
DomElement HTML Element Gets the root DOM element of the control.
Items Array

Gets the root level items.

Example Copy Code
<script type="text/javascript">
   
var menu1 = <%=RadMenu1.ClientID %>
   
function showRootItems()
   {
        
for (var i=0; i<menu1.Items.length; i++)
       {
           
alert(menu1.Items[i].Text);
       }
   }
   
showRootItems();
</script>
Enabled boolean True if the menu is enabled. To enable a menu, use the Enable() method.
AllItems Array

Gets a linear collection of all items. This includes all root and child items in the menu.

Example Copy Code
<script type="text/javascript">
   
var menu1 = <%=RadMenu1.ClientID %>
   
function showAllItems()
   {
        
for (var i=0; i<menu1.AllItems.length; i++)
       {
           
alert(menu1.AllItems[i].Text);
       }
   }
   
showAllItems();
</script>
OpenedItem RadMenuItem Gets the opened root level item. If no item is opened at the root level returns null.
FocusedItem RadMenuItem Gets the focused root level item. Null if no item is selected.

Events

Name Event Handler Parameters Description
OnClientLoad (RadMenu sender)

The client-side event handler is called after the menu is fully initialized on the client.

For more details, see the OnClientLoad topic.

OnClientMouseOver (RadMenu sender, Object eventArgs)

The client-side event handler is called when the mouse moves over a menu item. eventArgs exposes one property, Item: the instance of the menu item.

For more details, see the OnClientMouseOver topic.

OnClientMouseOut (RadMenu sender, Object eventArgs)

The client-side event handler is called when the mouse moves out of a menu item. eventArgs exposes one property, Item: the instance of the menu item.

For more details, see the OnClientMouseOut topic.

OnClientItemOpen (RadMenu sender, Object eventArgs)

The client-side event handler is called when a  group of child items opens. eventArgs exposes one property, Item: the instance of the menu item.

For more details, see the OnClientItemOpen topic.

OnClientItemFocus (RadMenu sender, Object eventArgs)

If specified, the OnClientItemFocus client-side event handler is called when a menu item is selected using either the keyboard (the [TAB] or arrow keys) or mouse click. eventArgs exposes one property, Item: the instance of the menu item.

For more details, see the OnClientItemFocus topic.

OnClientItemBlur (RadMenu sender, Object eventArgs)

The client-side event handler is called when a menu item loses focus as a result of the user pressing a key or mouse click. eventArgs exposes one property, Item: the instance of the menu item.

For more details, see the OnClientItemBlur topic.

OnClientItemClicking (RadMenu sender, Object eventArgs)

The client-side event handler is called before a menu item is clicked upon. eventArgs exposes one property, Item: the instance of the menu item. (The event is similar to OnClientItemFocus but fires only on mouse click.)

Can be cancelled: return False from the event handler.

For more details, see the OnClientItemClicking topic.

OnClientItemClicked (RadMenu sender, Object eventArgs)

The client-side event handler is called after a menu item is clicked upon. eventArgs exposes one property, Item: the instance of the menu item. (The event is similar to OnClientItemFocus but fires only on mouse click.)

For more details, see the OnClientItemClicked topic.

OnClientContextShowing (RadMenu sender)

This client-side event handler is called before the context menu is shown on the client.

For more details, see the OnClientContextShowing topic.

OnClientContextShown (RadMenu sender)

This client-side event handler is called after the context menu is shown on the client.

For more details, see the OnClientContextShown topic.

OnClientContextHidden (RadMenu sender)

This client-side event handler is called after the context menu is hidden on the client.

For more details, see the OnClientContextHidden topic.

 

For more details on handling client events, review the client events section.


See Also