New to Telerik UI for WinForms? Download free 30-day trial

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.

    WinForms RadContextMenu Smart Tag

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

    WinForms RadContextMenu Properties Window

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

    WinForms RadContextMenu ListBox ContextMenu

See Also

In this article