Edit this page

Assign RadContextMenu to Telerik and non-Telerik controls

You can easily assign a RadContextMenu to Telerik and non-Telerik controls. This can be achieved by making use of RadContextMenuManager component. This component will add a RadContextMenu property to all controls on the form. Then, you should simply set a RadContextMenu instance to the RadContextMenu property.

In the example below we are assigning RadContextMenu to RadListControl and Microsoft ListBox:

  1. Drop a RadContextMenu component on your form and add several RadMenuItems to it.

  2. Drop RadListControl and Microsoft ListBox on the form.

  3. Select the RadContextMenu component and click its Smart Tag. From the Action Menu click on the Add ContextMenuManager option. This will create a RadContextMenuManager instance and will add a RadContextMenu property to all the controls on our form.

    menus-context-menu-assign-radcontextmenu-to-telerik-and-non-telerik-controls 001

  4. Select RadListControl and Microsoft ListBox controls and set their RadContextMenu property to the RadContextMenu instance.

    menus-context-menu-assign-radcontextmenu-to-telerik-and-non-telerik-controls 002

  5. Run the project. When you right click on the ListBox or RadListControl the RadContextMenu instance will be displayed.

    menus-context-menu-assign-radcontextmenu-to-telerik-and-non-telerik-controls 003