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

Access Menu Items

This article shows how you can access the menu items. This is useful when you need to hide some items and disable specific functionality.

Hiding the top menu

The following snippet shows how you can hide the top menu which contains the Open, Save, Undo, and Redo buttons.

radImageEditor1.ImageEditorElement.CommandsElement.TopCommandsStackElement.Visibility = ElementVisibility.Collapsed;

Iterating the items

The following snippet shows how you can iterate all items a nd hide a specific menu item.

foreach (var item in radImageEditor1.ImageEditorElement.CommandsElement.CommandsStackElement.Children)
{
    if (item is RadMenuItem)
    {
        var menuItem = (RadMenuItem)item;
        Console.WriteLine(menuItem.Text);
        if (menuItem.Text == "Crop")
        {
            menuItem.Visibility = ElementVisibility.Collapsed;
        }

    }
}