Custom Dialogs
- 2 minutes to read
In addition to built-in dialogs available in ASPxHtmlEditor, you can add custom dialogs at design time and runtime.
To add custom dialogs to an editor, use its ASPxHtmlEditor.CustomDialogs collection. A custom dialog is an HtmlEditorCustomDialog class instance that has the following settings:
- HtmlEditorCustomDialog.Caption and HtmlEditorCustomDialog.Name. Use these properties to specify a dialog’s caption and name. The dialog’s name is used for reference, as described below.
- HtmlEditorCustomDialog.FormPath. Use this property to specify a path to a user control that defines a dialog form.
- HtmlEditorCustomDialog.OkButtonText, HtmlEditorCustomDialog.OkButtonVisible, HtmlEditorCustomDialog.CancelButtonText, and HtmlEditorCustomDialog.CancelButtonVisible. These properties allow you to specify the visibility and caption of two standard dialog buttons (the “OK” and “Cancel” buttons). You can customize default button captions as required.
You can associate a custom dialog with a toolbar item, which when clicked, invokes the dialog. To accomplish this, add a ToolbarCustomDialogButton toolbar item to ASPxHtmlEditor and assign the dialog’s name to the toolbar item’s ToolbarCustomDialogButton.Name property.
Custom Dialog Events
On the client side, ASPxHtmlEditor includes the following events to respond to user interactions with custom dialogs and dialog button clicks.
Event | Description |
---|---|
ASPxClientHtmlEditor.CustomDialogOpened | Fires after the custom dialog is opened. |
ASPxClientHtmlEditor.CustomDialogClosing | Fires before the custom dialog is closed (a click on a dialog button or the header’s close button initiates the close action). |
ASPxClientHtmlEditor.CustomDialogClosed | Fires after the custom dialog is closed. |