Skip to main content

HtmlEditorContextMenuItemCollection Class

A collection that maintains context menu items.

Namespace: DevExpress.Web.ASPxHtmlEditor

Assembly: DevExpress.Web.ASPxHtmlEditor.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public class HtmlEditorContextMenuItemCollection :
    Collection<HtmlEditorContextMenuItem>

The following members return HtmlEditorContextMenuItemCollection objects:

Library Related API Members
ASP.NET Web Forms Controls ASPxHtmlEditor.ContextMenuItems
ASP.NET MVC Extensions HtmlEditorSettings.ContextMenuItems

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.

Example

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