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

Collection of context menu items.

Definition

Namespace:Telerik.WinForms.RichTextEditor.RichTextBoxUI.Menus

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class ContextMenuGroup : IEnumerable

Inheritance: objectContextMenuGroup

Implements: IEnumerable

Constructors

Initializes a new instance of the ContextMenuGroup class.

C#
public ContextMenuGroup()

Initializes a new instance of the ContextMenuGroup class.

C#
public ContextMenuGroup(ContextMenuGroupType type, string name)
Parameters:typeContextMenuGroupType

The type of the group.

namestring

The name of the group.

Initializes a new instance of the ContextMenuGroup class.

C#
public ContextMenuGroup(ContextMenuGroupType type)
Parameters:typeContextMenuGroupType

The type of the group.

Initializes a new instance of the ContextMenuGroup class.

C#
public ContextMenuGroup(string name)
Parameters:namestring

The name of the group.

Properties

Gets the number of menu items in the group. Empty groups are omitted when the context menu is populated.

C#
public int Count { get; }

Gets the name of the group.

C#
public string Name { get; }
Property Value:

The name of the group.

Gets or replaces the menu item at the specified position in this group's display order.

C#
public RadMenuItemBase this[int index] { get; set; }
Parameters:indexint

The zero-based position of the item.

Property Value:

The menu item at the specified position.

Gets the type of the group.

C#
public ContextMenuGroupType Type { get; }
Property Value:

The type of the group.

Methods

Appends a menu item after the items already in this group.

C#
public void Add(RadMenuItemBase item)
Parameters:itemRadMenuItemBase

The menu item to add.

Removes all menu items from the group; an empty group is omitted when the context menu is populated.

C#
public void Clear()

Determines whether the specified menu item is in this group.

C#
public bool Contains(RadMenuItemBase item)
Parameters:itemRadMenuItemBase

The item to locate.

Returns:

bool

true if the item is in the group; otherwise, false.

Copies the menu items to an array, preserving their display order.

C#
public void CopyTo(RadMenuItemBase[] array, int arrayIndex)
Parameters:arrayRadMenuItemBase[]

The destination array.

arrayIndexint

The zero-based array position at which copying begins.

Returns an enumerator that visits the menu items in display order.

C#
public IEnumerator<RadMenuItemBase> GetEnumerator()
Returns:

IEnumerator<RadMenuItemBase>

An enumerator over the menu items in this group.

Returns the position of an item in the group, or -1 if the item is not present.

C#
public int IndexOf(RadMenuItemBase item)
Parameters:itemRadMenuItemBase

The item to locate.

Returns:

int

The item's zero-based position, or -1 if it is not in the group.

Inserts a menu item at the specified position, shifting later items in the group's display order.

C#
public void Insert(int index, RadMenuItemBase item)
Parameters:indexint

The zero-based position at which to insert the item.

itemRadMenuItemBase

The menu item to insert.

Removes the first occurrence of the specified menu item.

C#
public bool Remove(RadMenuItemBase item)
Parameters:itemRadMenuItemBase

The item to remove.

Returns:

bool

true if the item was removed; otherwise, false.

Removes the menu item at the specified position.

C#
public void RemoveAt(int index)
Parameters:indexint

The zero-based position of the item to remove.