The ASP.NET MVC Rich Text Editor (RichEdit extension) enables you to customize its context menu. By handling the PopupMenuShowing client-side event, you can perform the following actions with the ASPxRichEdit's context menu
- Manipulate menu items - add new items, remove or disable existing ones (use the e.menuItems property);
- Prevent the context menu from being displayed (use the e.cancel property).
In this demo, the PopupMenuShowing event is handled to illustrate the context menu customizing capabilities. Using check boxes, you can switch the context menu availability (via e.cancel) and control whether to clear or retain the default menu items when populating the menu with custom items (via e.menuItems). The custom items are implemented as ASPxClientRichEditPopupMenuItem objects by their name property. Clicks on custom menu items are processed using the CustomCommandExecuted client event. Its handler identifies the activated item by its name and performs the corresponding action on the client-side. In this demo, custom menu items create the Date and Time fields (using the createDateField and createTimeField client commands) and search the selected text in Google (the selected text is received via the Client API).
Local Copy of this Demo To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer. |
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxRichEditDemos |