# Handling Item Clicks

## Environment

<table>
<tbody>
<tr>
<th scope="row">Product Version</th>
<td>2026.1.415</td>
</tr>
<tr>
<th scope="row">Product</th>
<td>RadContextMenu for WPF</td>
</tr>
</tbody>
</table>

## Description

Handle a click on a RadContextMenu item by subscribing to the RadMenuItem Click event or the RadContextMenu ItemClick event.

## Solution

Choose the Click event for a specific menu item or the ItemClick event when one handler should process clicks from child menu items.

There are two ways to handle a click on an item:

* [Handle the Click event of the RadMenuItem](https://www.telerik.com/products/wpf/documentation/knowledge-base/kb-contextmenu-handle-item-clicks#handle-the-click-event-of-the-radmenuitem)

* [Handle the ItemClick event of the RadContextMenu](https://www.telerik.com/products/wpf/documentation/knowledge-base/kb-contextmenu-handle-item-clicks#handle-the-itemclick-event-of-the-radcontextmenu)

## Handle the Click Event of the RadMenuItem

Handling the **Click** event of each item is the straight-forward way. But it has some **disadvantages**:

* You have to attach an event handler to each item. This makes the code harder to maintain.

* It is not suitable when having dynamic items.

> note If the **RadMenuItem** is in the role of a header (has child items), the **ItemClick** event will not be raised unless the **NotifyOnHeaderClick** property is set to **True**.

Here is an example of an event handler attached to the **Click** event and how to get the instance of the clicked item.

**Attach RadMenuItem Click Handlers**

```XAML
<telerik:RadContextMenu xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <telerik:RadMenuItem Header="Item 1"
                         Click="RadMenuItem_Click" />
    <telerik:RadMenuItem Header="Item 2"
                         Click="RadMenuItem_Click" />
    <telerik:RadMenuItem Header="Item 3"
                         Click="RadMenuItem_Click" />
</telerik:RadContextMenu>
```

**Handle the Click Event in C#**

```C#
private void RadMenuItem_Click( object sender, RadRoutedEventArgs e )
{
    RadMenuItem item = sender as RadMenuItem;
    //implement the logic regarding the instance here.
}
```

The handler receives the clicked `RadMenuItem` through the `sender` argument.

## Handle the ItemClick Event of the RadContextMenu

Handling the **ItemClick** event of the **RadContextMenu** gives you more flexibility, as it fires each time a child menu item is clicked. This approach is the most suitable when having a dynamic data scenario.

> note If the **RadMenuItem** is in the role of a header (has child items), the **ItemClick** event will not be raised unless the **NotifyOnHeaderClick** property is set to **True**.

Here is an example of an event handler attached to the **ItemClick** event and how to get the instance of the clicked item.

**Attach the RadContextMenu ItemClick Handler**

```XAML
<telerik:RadContextMenu xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                        ItemClick="radContextMenu_ItemClick">
    <telerik:RadMenuItem Header="Item 1" />
    <telerik:RadMenuItem Header="Item 2" />
    <telerik:RadMenuItem Header="Item 3" />
</telerik:RadContextMenu>
```

**Handle the ItemClick Event in C#**

```C#
private void radContextMenu_ItemClick(object sender, RadRoutedEventArgs e)
{
    RadMenuItem item = e.OriginalSource as RadMenuItem;
    //implement the logic regarding the instance here.
}
```

The `ItemClick` handler receives the clicked item from `e.OriginalSource`.

## See Also

* [Getting Started](https://www.telerik.com/products/wpf/documentation/controls/radcontextmenu/getting-started)

* [Events - Overview](https://www.telerik.com/products/wpf/documentation/controls/radcontextmenu/events)

* [Use RadContextMenu with a RadGridView](https://www.telerik.com/products/wpf/documentation/knowledge-base/kb-contextmenu-use-with-radgridview)

* [Select the clicked Item of a RadTreeView](https://www.telerik.com/products/wpf/documentation/knowledge-base/kb-contextmenu-select-clicked-item-radtreeview)

* [Create Menu Button with RadContextMenu and ToggleButton](https://www.telerik.com/products/wpf/documentation/knowledge-base/kb-contextmenu-create-menu-button-with-togglebutton)

* [Use Commands with the RadContextMenu](https://www.telerik.com/products/wpf/documentation/knowledge-base/kb-contextmenu-use-commands)
