Menu Toolbar
- 3 minutes to read
Menu toolbars are displayed in the ASPxHtmlEditor when the ASPxHtmlEditor.ToolbarMode property is set to Menu.
The ASPxHtmlEditor.Toolbars property allows you to access a toolbar collection of the HtmlEditorToolbarCollection class. To access or add/delete an individual toolbar, you can use its index or name.
An individual menu toolbar object is a descendant of the HtmlEditorToolbar class. Use the HtmlEditorToolbar.Visible and HtmlEditorToolbar.VisibleIndex properties to customize the toolbar’s visibility and visible order relative to the other toolbars. To define a toolbar’s unique identifier name, which can be used to obtain the toolbar at runtime, use the HtmlEditorToolbar.Name property.
Each menu toolbar implements the HtmlEditorToolbar.Items collection that can contain a set of toolbar items (default or custom).
At design time, you can use the ASPxHtmlEditor Designer to modify toolbar and item collections.
Default Toolbars
ASPxHtmlEditor supports the following default toolbars that contain predefined sets of default toolbar items grouped by functionality:
The StandardToolbar1 contains default toolbar items (listed below) that have shortcuts to many frequently used operations. To create this toolbar in code, call the HtmlEditorToolbar.CreateStandardToolbar1 method.
- Cut (ToolbarCutButton)
- Copy (ToolbarCopyButton)
- Paste (ToolbarPasteButton)
- Paste from Word (ToolbarPasteFromWordButton)
- Undo (ToolbarUndoButton)
- Redo (ToolbarRedoButton)
- Remove Format (ToolbarRemoveFormatButton)
- Superscript (ToolbarSuperscriptButton)
- Subscript (ToolbarSubscriptButton)
- Ordered List (ToolbarInsertOrderedListButton)
- Bullet list (ToolbarInsertUnorderedListButton)
- Insert Link (ToolbarInsertLinkDialogButton)
- Unlink (ToolbarUnlinkButton)
- Insert Image (ToolbarInsertImageDialogButton)
- Table Operations (ToolbarTableOperationsDropDownButton)
- Full Screen (ToolbarFullscreenButton)
The StandardToolbar2 contains default toolbar items (listed below) that help users perform text formatting operations. To create this toolbar in code, call the HtmlEditorToolbar.CreateStandardToolbar2 method.
- Paragraph (ToolbarParagraphFormattingEdit)
- Font Name (ToolbarFontNameEdit)
- Font Size (ToolbarFontSizeEdit)
- Bold (ToolbarBoldButton)
- Italic (ToolbarItalicButton)
- Underline (ToolbarUnderlineButton)
- Strikethrough (ToolbarStrikethroughButton)
- Align Left (ToolbarJustifyLeftButton)
- Align Center (ToolbarJustifyCenterButton)
- Align Right (ToolbarJustifyRightButton)
- Back Color (ToolbarBackColorButton)
- Fore Color (ToolbarFontColorButton)
To add both standard toolbars to this collection at runtime, call the ASPxHtmlEditor.CreateDefaultToolbars method.
The TableToolbar contains the following default toolbar items to work with tables:
- Insert Table (ToolbarInsertTableDialogButton)
- Table Properties (ToolbarTablePropertiesDialogButton)
- Row Properties (ToolbarTableRowPropertiesDialogButton)
- Column Properties (ToolbarTableColumnPropertiesDialogButton)
- Cell Properties (ToolbarTableCellPropertiesDialogButton)
- Insert Row Above (ToolbarInsertTableRowAboveButton)
- Insert Row Below (ToolbarInsertTableRowBelowButton)
- Insert Column to the Left (ToolbarInsertTableColumnToLeftButton)
- Insert Column to the Right (ToolbarInsertTableColumnToRightButton)
- Split Horizontally (ToolbarSplitTableCellHorizontallyButton)
- Split Vertically (ToolbarSplitTableCellVerticallyButton)
- Merge Right (ToolbarMergeTableCellRightButton)
- Merge Down (ToolbarMergeTableCellDownButton)
- Delete Table (ToolbarDeleteTableButton)
- Delete Row (ToolbarDeleteTableRowButton)
- Delete Column (ToolbarDeleteTableColumnButton)
To create this toolbar in code, call the HtmlEditorToolbar.CreateTableToolbar method.
Custom toolbars
The ASPxHtmlEditor allows you to create custom toolbars, which can contain custom or default toolbar items. As HtmlEditorToolbar class instances, custom toolbars can implement the default toolbar functionality.
Note
View the Example: How to: Create custom toolbar items