New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Migrating From RadMenu ASP.NET to ASP.NET AJAX

RadMenu for ASP.NET AJAX contains a number of changes because of moving from the ASP.NET to the Ajax framework of the Telerik.Web.UI suite.These changes are listed below:

Context menu

The context menu functionality has been separated as a new control – RadContextMenu.

Server-side API changes

The changes to the server-side API are minimal:

  • GetAllItems now returns IList, instead of an ArrayList.

  • ImageOverUrl has been renamed to HoveredImageUrl.

Client-side API changes

The client-side API of RadMenu for ASP.NET AJAX has been heavily revised to accommodate new features. In addition, all for ASP.NET AJAX controls follow the MS AJAX naming convention. In order to migrate from RadMenu "Classic", the method calls and property accessors should use the new convention. A reference table is included below.

RadMenu class

 

RadMenu "Classic"RadMenu for ASP.NET AJAX
Methods
Closeclose
Disabledisable
DisableEventsdisableEvents
Enableenable
EnableEventsenableEvents
FindItemById-
FindItemByTextfindItemByText
FindItemByUrlfindItemByUrl
FindItemByValuefindItemByValue
-findItemByAttribute
Focusfocus
GetAttributegetAttributes().getAttribute
Hide->RadContextMenu.hide
MouseEventX-
MouseEventY-
SetAttributegetAttributes().setAttribute
SetContextElementIDuse RadContextMenu.set_targets
Show->RadContextMenu.show
ShowAt->RadContextMenu.showAt
AttachEventadd_
DetachEventremove_
TrackClientChangestrackChanges
CommitClientChangescommitChanges
Properties
AllItemsget_allItems
Enabledget_enabled, set_enabled
FocusedItemget_focusedItem
IDget_id
Itemsget_item
OpenedItemget_openedItem
ClickToOpenget_clickToOpen, set_clickToOpen
ExpandDelayget_expandDelay, set_expandDelay
CollapseDelayget_collapseDelay, set_collapseDelay
Templatedget_templated
CssClassget_cssClass, set_cssClass
DomElementget_element
Events
ItemBluritemBlur
ItemFocusitemFocus
ItemClickeditemClicked
ItemClickingitemClicking
ItemCloseitemClosing, itemClosed
MouseOvermouseOver
MouseOutmouseOut
ItemOpenitemOpening, itemOpened
ContextShowingRadContextMenu.showing
ContextShownRadContextMenu.shown
ContextHiddenRadContextMenu.hidden

RadMenuItem class

 

RadMenu "Classic"RadMenu for ASP.NET AJAX
Methods
Blurblur
Closeclose
Disabledisable
Enableenable
Focusfocus
FocusFirstChildfocusFirstChild
FocusLastChildfocusLastChild
FocusNextItemfocusNextItem
FocusPreviousItemfocusPreviousItem
GetAttributeget_attributes().getAttribute
GetNextItemget_nextItem
GetPreviousItemget_previousItem
Hidehide
IsVisibleget_visible
Openopen
SetAttributeget_attributes().setAttribute
SetImageOverUrlget_imageOverUrl, set_imageOverUrl
SetImageUrlget_imageUrl, set_imageUrl
SetTextget_text, set_text
SetValueget_value, set_value
Showshow
Properties
DomElementget_element
Enabledget_enabled, set_enabled
Focusedget_focused, set_focused
FocusedItemget_focusedItem
GlobalIndex-
ID-
ImageElementget_imageElement
Indexget_index
IsSeparatorget_isSeparator
Itemsget_item
Levelget_level
LinkElementget_linkElement
Menuget_menu
OpenedItemget_openedItem
Parentget_parent
Textget_textset_text
TextElementget_textElement
Valueget_valueset_value

RadMenuItemCollection class

The items property of RadMenu returns a fully-featured collection object. Here is a brief reference:

 

MemberNotes
Methods
add(item)Adds an item to the end of the collection.
insert(index, item)Inserts an item at the specified index.
remove(item)Removes an item from the collection.
clear()Clears the collection.
getItem(index)Gets a specific item by index.
indexOf(item)Finds the index of a specified item in the collection.
removeAt(index)Removes an item at the specified index.
Properties
get_count()Returns the number of items in the collection.

CSS class names

The CSS class names have been prefixed with "rm" in order to avoid overlapping with other controls.

 

RadMenu "Classic"RadMenu for ASP.NET AJAX
bottomArrowrmBottomArrow
clickedrmClicked
disabledrmDisabled
expandBottomrmExpandBottom
expandedrmExpanded
expandLeftrmExpandLeft
expandRightrmExpandRight
expandToprmExpandTop
firstrmFirst
focusedrmFocused
grouprmGroup
horizontalrmHorizontal
itemrmItem
lastrmLast
leftArrowrmLeftArrow
leftImagermLeftImage
levelrmLevel
linkrmLink
rightArrowrmRightArrow
rootGrouprmRootGroup
scrollWraprmScrollWrap
separatorrmSeparator
slidermSlide
templatermTemplate
textrmText
topArrowrmTopArrow
verticalrmVertical

See Also