A newer version of this page is available. Switch to the current version.

HtmlEditorContextMenuItemCollection Class

A collection that maintains context menu items.

Namespace: DevExpress.Web.ASPxHtmlEditor

Assembly: DevExpress.Web.ASPxHtmlEditor.v18.2.dll

Declaration

public class HtmlEditorContextMenuItemCollection :
    Collection<HtmlEditorContextMenuItem>
Public Class HtmlEditorContextMenuItemCollection
    Inherits Collection(Of HtmlEditorContextMenuItem)

Related API Members

The following members accept/return HtmlEditorContextMenuItemCollection objects:

Remarks

Context menu items are stored within a collection specified by instances of the HtmlEditorContextMenuItemCollection class. The collection can be accessed via the ASPxHtmlEditor.ContextMenuItems property of an ASPxHtmlControl.

The properties and methods exposed by the HtmlEditorContextMenuItemCollection class can be used to perform common collection operations such as adding new or deleting the existing items. Each item of the collection is represented by an HtmlEditorContextMenuItem object. Individual items can be accessed using either indexer notation or their command names via the specific methods of the collection.

Examples

using DevExpress.Web.ASPxHtmlEditor;

...

protected void Page_Load(object sender, EventArgs e) {
     if (!IsPostBack) {
          MyHtmlEditor.ContextMenuItems.CreateDefaultItems();
          MyHtmlEditor.ContextMenuItems.Insert(0, new HtmlEditorContextMenuItem("Add Title...", "AddTitle"));
          MyHtmlEditor.ContextMenuItems.Insert(1, new HtmlEditorContextMenuItem("Change Title...", "ChangeTitle"));
          MyHtmlEditor.ContextMenuItems.Insert(2, new HtmlEditorContextMenuItem("Remove Title", "RemoveTitle"));
     }
}
See Also