# Creating a Simple Context Menu

This tutorial will walk you through creating a simple **RadContextMenu** and shows how to:

* Use the **RadMenu Item Editor** to build a simple context menu.

* Use the Targets collection to attach the context menu to another control.

1. Drag a **RadContextMenu** component from the toolbox onto your Web page. The **RadContextMenu** [Smart Tag](https://www.telerik.com/products/aspnet-ajax/documentation/controls/menu/design-time/smart-tag) should appear automatically:

   ![RadMenu Smart Tag](https://www.telerik.com/products/aspnet-ajax/documentation/assets/3dc78c962f942b4a1f9f649c0a459d6f/menu_smarttag.png)

2. On the Smart Tag, choose **Edit Items.** The [RadMenu Item Builder](https://www.telerik.com/products/aspnet-ajax/documentation/controls/menu/design-time/radmenu-item-builder) appears:![Contextmenu ItemBuilder](https://www.telerik.com/products/aspnet-ajax/documentation/assets/f96b1410459715c4535fbd0b6eef8474/menu_contextmenuitembuilder.png)

3. Click the **Add root item** button (![RadMenu Add Root Item](https://www.telerik.com/products/aspnet-ajax/documentation/assets/ab40f63e6ee313cd4b30f664e23ae72a/menu_addrootitem.png)) to add a root item to your menu.

4. With the root item selected, click the **Add child item** button (![RadMenu Add Child Item](https://www.telerik.com/products/aspnet-ajax/documentation/assets/6273001ee8b1e9b6aca1f0e4eda98378/menu_addchilditem.png)) to add a child to your root item.

5. Add some more root items, and child items using the **Add root item** button and the **Add child item** button:![Contextmenu SampleMenu](https://www.telerik.com/products/aspnet-ajax/documentation/assets/b3a09940393f2ee014485cd6e713fa88/menu_contextmenusamplemenu.png)

6. Select one of the child items, and change its **IsSeparator** property to **True** and its **Text** property to an empty string (""):![Contextmenu IsSeparator](https://www.telerik.com/products/aspnet-ajax/documentation/assets/314faa7e5460edae52a1a2f3dce4ca1c/menu_contextmenuisseparator.png)

7. Click **OK** to confirm and exit.

8. Right click on the **RadContextMenu**, and from its context menu, choose **Properties**.

9. From the Standard area of the toolbox, drag a **Label** onto your page. Set its **Text** property to "Label1".

10. Move to the Source view of your Web page and locate the declaration of your **RadContextMenu**.

11. Select **Edit Targets** from the smart tag.![RadContextMenu Targets](https://www.telerik.com/products/aspnet-ajax/documentation/assets/7f79224f2e8169e15289766d8ea2a840/menu_targets.png)

12. From the **Target Editor** select to **Add Control Target**. This attaches your context menu to a specific control, based on its ID:![RadContextMenu Control Target](https://www.telerik.com/products/aspnet-ajax/documentation/assets/018cb79f076142214895a3aa685ad06e/menu_controltarget.png)

13. Select the ControlID attribute from the dropdown that appears:![RadContextMenu ControlID](https://www.telerik.com/products/aspnet-ajax/documentation/assets/83d5c52fb3d31b0eb68c67c2c4ab92b1/menu_controlid.png)

14. Select **Ok** and run the application. Right-click on the label and see your context menu appear:![RadContextMenu](https://www.telerik.com/products/aspnet-ajax/documentation/assets/27000f14324a3115f8e8fb9ae4616f48/menu_contextmenu1.png)

## See Also

* [RadContextMenu Object](https://www.telerik.com/products/aspnet-ajax/documentation/controls/menu/context-menus/radcontextmenu-object)
