The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientHtmlEditor.ContextMenuShowing Event

Occurs on the client side before a context menu is shown.

Declaration

ContextMenuShowing: ASPxClientEvent<ASPxClientEventHandler<ASPxClientHtmlEditor>>

Event Data

The ContextMenuShowing event handler receives an argument of the ASPxClientEventArgs type.

Remarks

Write a ContextMenuShowing event handler to perform specific actions on the client side before every time the context menu is shown. You can use this event to show/hide menu items based on the currently selected element.

Examples

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