New to Telerik UI for WinFormsStart a free 30-day trial

Access Menu Items

Updated over 6 months ago

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.

C#
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.

C#
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;
        }
      
    }
}