Back to Devexpress

HtmlEditorContextMenuItemCollection Class

aspnet-devexpress-dot-web-dot-aspxhtmleditor-077ae6e9.md

latest4.2 KB
Original Source

HtmlEditorContextMenuItemCollection Class

A collection that maintains context menu items.

Namespace : DevExpress.Web.ASPxHtmlEditor

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

NuGet Package : DevExpress.Web

Declaration

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

The following members return HtmlEditorContextMenuItemCollection objects:

LibraryRelated API Members
ASP.NET Web Forms ControlsASPxHtmlEditor.ContextMenuItems
ASP.NET MVC ExtensionsHtmlEditorSettings.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

csharp
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"));
     }
}

Implements

IList

ICollection

IStateManager

DevExpress.Utils.IAssignableCollection

IList<HtmlEditorContextMenuItem>

ICollection<HtmlEditorContextMenuItem>

IEnumerable<HtmlEditorContextMenuItem>

IEnumerable

Inheritance

Object StateManagedCollectionBase Collection Collection<HtmlEditorContextMenuItem> HtmlEditorContextMenuItemCollection

See Also

HtmlEditorContextMenuItemCollection Members

HTML Editor

DevExpress.Web.ASPxHtmlEditor Namespace