# Run-Time Customization

## Content

At run time, you can inspect and change the properties of a menu and its items, and you can expand or collapse the menu from other parts of your UI. Use this to build a settings view, to test property values during development, or to let users control the menu.

***

## Edit Properties with a PropertyGrid

Assign [C1HamburgerMenu](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.C1HamburgerMenu.html) or an individual menu item to the `SelectedObject` property of a `PropertyGrid`. The grid then shows the properties of that object, and users can modify them at run time.
The following example shows the properties of the menu:

```csharp
propertyGrid1.SelectedObject = c1HamburgerMenu1;
```

The following example shows the properties of a specific menu item, in this case the third item in the `Items` collection:

```csharp
propertyGrid1.SelectedObject = c1HamburgerMenu1.Items[2];
```

***

## Expand or Collapse the Menu from Code

The `IsExpanded` property controls whether the menu is expanded. You can set it from other UI elements, such as a command or a `ContextMenuStrip` item.
The following example expands the menu:

```csharp
c1HamburgerMenu1.IsExpanded = true;
```

To collapse the menu, set the property to `false`.