ASPxClientHtmlEditor.GetContextMenu Method
Returns a collection of client context menu objects.
Declaration
GetContextMenu(): ASPxClientPopupMenu
Returns
Type | Description |
---|---|
ASPxClientPopupMenu | An ASPxClientPopupMenu object that is the client-side collection of context menu objects. |
Remarks
Use the GetContextMenu method on the client-side to access the collection of context menu objects. A particular menu object can be accessed by its name within the collection using the ASPxClientMenuBase.GetItemByName method.
Example
The code sample below demonstrates how you can handle the ASPxClientHtmlEditor.ContextMenuShowing event to change the content of a context menu (by changing its items visibility).
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