# Mutually Exclusive Checkable Menu Items

## Content



With the **C1Menu** control, you can create a list of checkable menu items that are grouped together so that only one item can be checked at a time.

### In XAML

Complete the following steps:

1.  Add **IsCheckable="True"** and **GroupName="CheckableGroup"** to the **<c1:C1MenuItem>** tag of each menu item you wish to add to the group of mutually exclusive checkable items.
2.  Run the program and click the first item in the group. Observe that a check is added to the menu item. Now click the second item in the group and observe that the check is removed from the first item and then added to the second item.

### In Code

Complete the following steps:

1.  Set the **x:Name** property of each **C1MenuItem** you wish to add to the group of mutually exclusive checkable items.
2.  Open the **MainPage.xaml.cs** page.
3.  Set the [IsCheckable](/componentone/api/wpf/online-menu5/dotnet-api/C1.WPF.Menu/C1.WPF.Menu.C1MenuItem.IsCheckable.html) and [GroupName](/componentone/api/wpf/online-menu5/dotnet-api/C1.WPF.Menu/C1.WPF.Menu.C1MenuItem.GroupName.html) property of each menu item, replacing **"ItemName"** with the value of the menu item's **x:Name** property.

```vbnet
ItemName.IsCheckable = True
ItemName.GroupName = CheckableGroup
```

```csharp
ItemName.IsCheckable = true;
ItemName.GroupName = CheckableGroup;
```

4.  Run the program and click the first item in the group. Observe that a check is added to the menu item. Now click the second item in the group and observe that the check is removed from the first item and then added to the second item.

### At Design Time

Complete the following steps:

1.  In Design view, select the first **C1MenuItem** you wish to make checkable and then set the following properties in the Properties window:

Set the **IsCheckable** property to **True**.

Set the **GroupName** property to a string, such as **"CheckableGroup"**.

2.  Repeat step 1 for any other menu items you wish to add to the group of mutually exclusive checkable items.
3.  Run the program and click the first item in the group. Observe that a check is added to the menu item. Now click the second item in the group and observe that the check is removed from the first item and then added to the second item.