Back to Devexpress

Image Dialogs

aspnet-7494-components-html-editor-concepts-dialogs-image-dialogs.md

latest5.8 KB
Original Source

Image Dialogs

  • Jun 16, 2022
  • 2 minutes to read

Image dialogs include the Insert Image and Change Image dialogs that allow users to insert an image into editor content and change an image, respectively.

In the Design View, use the techniques below to invoke a dialog:

Click the Insert Image button on the Menu toolbar (the ToolbarInsertImageDialogButton class) or the Ribbon (the HEInsertImageRibbonCommand class).

Dialog Structure

An image dialog contains three tabs listed below.

Tab captionTab visibilityDescription
From your computerHtmlEditorInsertImageDialogSettings.ShowFileUploadSectionAllows users to upload their local files.
From the galleryHtmlEditorFileManagerSettingsBase.EnabledAllows users to add images from the predefined gallery to editor content. To customize the gallery settings, use the HtmlEditorInsertImageDialogSettings.SettingsImageSelector and HtmlEditorInsertImageDialogSettings.SettingsImageUpload properties.
From the web (URL)HtmlEditorInsertMediaDialogSettings.ShowInsertFromWebSectionAllows users to upload files from the web.

When the More options check box is selected, the dialog displays the settings section, which allows users to customize image settings (size, position, description, and style settings such as margins, border, and CSS class). To hide the check box, set the HtmlEditorInsertImageDialogSettings.ShowMoreOptionsButton property to false.

Dialog Customization

At design time, you can use the ASPxHtmlEditor Designer to customize dialog settings. Programmatically, you can specify the HtmlEditorDefaultDialogSettings.InsertImageDialog property for this purpose.

Online Demo

Image Selector

On the client side, the ASPxHtmlEditor API allows you to manage the opened dialog programmatically.

|

Dialog UI elements

|

Client method

| | --- | --- | |

Common Dialog UI elements

|

ASPxClientHtmlEditorMediaDialogBase.GetMoreOptionsCheckBox

ASPxClientHtmlEditorDialogBase.GetOkButton

ASPxClientHtmlEditorDialogBase.GetCancelButton

| |

“From the web (URL)” UI elements

|

ASPxClientHtmlEditorLinkDialog.GetUrlTextBox

| |

“Common Settings” Tab UI elements

|

GetSizeComboBox()

ASPxClientHtmlEditorMediaDialogBase.GetPositionComboBox

ASPxClientHtmlEditorImageDialog.GetWrapTextCheckBox

ASPxClientHtmlEditorImageDialog.GetDescriptionTextBox

| |

“Style Settings” Tab UI elements

|

ASPxClientHtmlEditorEditElementDialog.GetTopMarginTextBox

ASPxClientHtmlEditorEditElementDialog.GetRightMarginTextBox

ASPxClientHtmlEditorEditElementDialog.GetBottomMarginTextBox

ASPxClientHtmlEditorEditElementDialog.GetLeftMarginTextBox

ASPxClientHtmlEditorEditElementDialog.GetBorderWidthSpinEdit

ASPxClientHtmlEditorEditElementDialog.GetBorderColorColorEdit

ASPxClientHtmlEditorEditElementDialog.GetBorderStyleComboBox

|