Commands
The RadRichTextEditor control exposes a full set of commands that are exposed through its Commands property. For each of the Formatting API methods there is a respective command.
The following list shows all available RadRichTextEditor commands.
Commands
Property | Description |
---|---|
TabBackwardCommand | Tab Backward Command. |
TabForwardCommand | Tab Forward Command. |
NewDocumentCommand | New Document Command. |
OpenDocumentCommand | Open Document Command. |
PrintCommand | Print Command. |
PrintPreviewCommand | Print Preview Command. |
SaveCommand | Save Command. |
MultipleUndoCommand | Multiple Undo Command. |
UndoCommand | Undo Command. |
RedoCommand | Redo Command. |
ChangeFontFamilyCommand | Change Font Family Command. |
ChangeFontSizeCommand | Change Font Size Command. |
ChangeFontForeColorCommand | Change Font Fore Color Command. |
ChangeFontHighlightColorCommand | Change Font Highlight Color Command. |
ToggleBoldCommand | Toggle Bold Command. |
ToggleItalicCommand | Toggle Italic Command. |
ToggleStrikethroughCommand | Toggle Strikethrough Command. |
ToggleSubscriptCommand | Toggle Subscript Command. |
ToggleSuperscriptCommand | Toggle Superscript Command. |
ToggleUnderlineCommand | Toggle Underline Command. |
ToggleFormattingSymbolsCommand | Toggle Formatting Symbols Command. |
ChangeFormatPainterStateCommand | Change Format Painter State Command. |
IncrementFontSizeCommand | Increment Font Size Command. |
DecrementFontSizeCommand | Decrement Font Size Command. |
ToggleBulletsCommand | Toggle Bullets Command. |
ToggleNumberedCommand | Toggle Numbered Command. |
ChangeListStyleCommand | Change List Style Command. |
ChangeTextAlignmentCommand | Change Text Alignment Command. |
ChangeParagraphFlowDirectionCommand | Change Paragraph Flow Direction Command. |
IncrementParagraphLeftIndentCommand | Increment Paragraph Left Indent Command. |
DecrementParagraphLeftIndentCommand | Decrement Paragraph Left Indent Command. |
ChangeUnderlineDecorationCommand | Change Underline Decoration Command. |
ChangeParagraphListLevelCommand | Change Paragraph List Level Command. |
IncrementParagraphListLevelCommand | Increment Paragraph List Level Command. |
DecrementParagraphListLevelCommand | Decrement Paragraph List Level Command. |
ChangeLayoutModeCommand | Change Layout Mode Command. |
ClearAllFormattingCommand | Clear All Formatting Command. |
ClearFormattingCommand | Clear Formatting Command. |
CopyCommand | Copy Command. |
CopyFormattingCommand | Copy Formatting Command. |
CutCommand | Cut Command. |
PasteCommand | Paste Command. |
PasteFormattingCommand | Paste Formatting Command. |
CancelFormatPainterCommand | Cancel Format Painter Command. |
DeleteCommand | Delete Command. |
InsertTextCommand | Insert Text Command. |
InsertDocumentFragmentCommand | Insert Document Fragment Command. |
InsertSectionBreakCommand | Insert Section Break Command. |
InsertPageBreakCommand | Insert Page Break Command. |
InsertLineBreakCommand | Insert Line Break Command. |
InsertColumnBreakCommand | Insert Column Break Command. |
InsertNonBreakingSpaceCommand | Insert Non Breaking Space Command. |
InsertBreakCommand | Insert Break Command. |
InsertPictureCommand | Insert Picture Command. |
ShowInsertHyperlinkDialogCommand | Show Insert Hyperlink Dialog Command. |
ShowManageBookmarksDialogCommand | Show Manage Bookmarks Dialog Command. |
ShowInsertSymbolWindowCommand | Show Insert Symbol Window Command. |
ShowInsertCrossReferenceWindowCommand | Show Insert Cross Reference Window Command. |
ShowInsertTableOfContentsDialogCommand | Show Insert Table Of Contents Dialog Command. |
ShowInsertCaptionDialogCommand | Show Insert Caption Dialog Command. |
ShowParagraphPropertiesDialogCommand | Show Paragraph Properties Dialog Command. |
ShowSectionColumnsDialogCommand | Show Section Columns Dialog Command. |
ChangePageMarginsCommand | Change Page Margins Command. |
ChangePageOrientationCommand | Change Page Orientation Command. |
ChangePaperTypeCommand | Change Paper Type Command. |
ShowFindReplaceDialogCommand | Show Find Replace Dialog Command. |
ShowFontPropertiesDialogCommand | Show Font Properties Dialog Command. |
ShowTablePropertiesDialogCommand | Show Table Properties Dialog Command. |
ShowTableBordersDialogCommand | Show Table Borders Dialog Command. |
ShowSpellCheckingDialogCommand | Show Spell Checking Dialog Command. |
ShowInsertTableDialogCommand | Show Insert Table Dialog Command. |
InsertTableCommand | Insert Table Command. |
InsertTableColumnCommand | Insert Table Column Command. |
InsertTableColumnToTheLeftCommand | Insert Table Column To The Left Command. |
InsertTableColumnToTheRightCommand | Insert Table Column To The Right Command. |
InsertTableRowCommand | Insert Table Row Command. |
InsertTableRowAboveCommand | Insert Table Row Above Command. |
InsertTableRowBelowCommand | Insert Table Row Below Command. |
SelectTableEmptyCommand | Select Table Empty Command. |
SelectTableCommand | Select Table Command. |
SelectTableCellCommand | Select Table Cell Command. |
SelectTableRowCommand | Select Table Row Command. |
SelectTableColumnCommand | Select Table Column Command. |
DeleteTableCommand | Delete Table Command. |
DeleteTableRowCommand | Delete Table Row Command. |
DeleteTableColumnCommand | Delete Table Column Command. |
ToggleTableLookFirstRowOptionCommand | Toggle Table Look First Row Option Command. |
ToggleTableLookLastRowOptionCommand | Toggle Table Look Last Row Option Command. |
ToggleTableLookFirstColumnOptionCommand | Toggle Table Look First Column Option Command. |
ToggleTableLookLastColumnOptionCommand | Toggle Table Look Last Column Option Command. |
ToggleTableLookRowBandingOptionCommand | Toggle Table Look Row Banding Option Command. |
ToggleTableLookColumnBandingOptionCommand | Toggle Table Look Column Banding Option Command. |
MergeTableCellsCommand | Merge Table Cells Command. |
ToggleTableRowRepeatOnEveryPageCommand | Toggle Table Row Repeat On Every Page Command. |
UnmergeTableCellsCommand | Unmerge Table Cells Command. |
ToggleSpellCheckingCommand | Toggle Spell Checking Command. |
OpenContextMenuOnNextSpellingErrorCommand | Open Context Menu On Next Spelling Error Command. |
TableCellContentAlignmentCommand | Table Cell Content Alignment Command. |
ChangeTableColumnsLayoutModeCommand | Change Table Columns Layout Mode Command. |
ChangeParagraphBackgroundColorCommand | Change Paragraph Background Color Command. |
MoveCaretCommand | Move Caret Command. |
SelectAllCommand | Select All Command. |
InsertCommentCommand | Insert Comment Command. |
RemoveHyperlinkCommand | Remove Hyperlink Command. |
DeleteCommentCommand | Delete Comment Command. |
DeleteAllCommentsCommand | Delete All Comments Command. |
GoToNextCommentCommand | Go To Next Comment Command. |
GoToPreviousCommentCommand | Go To Previous Comment Command. |
GoToNextRevisionCommand | Go To Next Revision Command. |
GoToPreviousRevisionCommand | Go To Previous Revision Command. |
AcceptRevisionCommand | Accept Revision Command. |
RejectRevisionCommand | Reject Revision Command. |
AcceptAllRevisionsCommand | Accept All Revisions Command. |
RejectAllRevisionsCommand | Reject All Revisions Command. |
ToggleTrackChangesCommand | Toggle Track Changes Command. |
SelectHyperlinkCommand | Select Hyperlink Command. |
ToggleCommentsCommand | Toggle Comments Command. |
OpenHyperlinkCommand | Open Hyperlink Command. |
CopyHyperlinkCommand | Copy Hyperlink Command. |
ShowImageEditorCommand | Show Image Editor Command. |
ChangeSectionColumnsCommand | Change Section Columns Command. |
ChangeSectionHeaderTopMarginCommand | Change Section Header Top Margin Command. |
ChangeSectionFooterBottomMarginCommand | Change Section Footer Bottom Margin Command. |
ToggleDifferentFirstPageHeaderFooterCommand | Toggle Different First Page Header Footer Command. |
ToggleDifferentOddAndEvenPagesHeaderFooterCommand | Toggle Different Odd And Even Pages Header Footer Command. |
ShowFloatingBlockPropertiesDialogCommand | Show Floating Block Properties Dialog Command. |
ShowTabStopsPropertiesDialogCommand | Show Tab Stops Properties Dialog Command. |
ChangeImageWrappingStyleCommand | Change Image Wrapping Style Command. |
ConvertImageToImageInlineCommand | Convert Image To Image Inline Command. |
InsertFieldCommand | Insert Field Command. |
InsertCitationFieldCommand | Insert Citation Field Command. |
InsertBibliographyFieldCommand | Insert Bibliography Field Command. |
ShowAddNewBibliographicReferenceDialogCommand | Show Add New Bibliographic Reference Dialog Command. |
ShowManageBibliographicSourcesDialogCommand | Show Manage Bibliographic Sources Dialog Command. |
InsertPageFieldCommand | Insert Page Field Command. |
ToggleFieldDisplayModeCommand | Toggle Field Display Mode Command. |
ChangeAllFieldsDisplayModeCommand | Change All Fields Display Mode Command. |
PreviewFirstMailMergeDataRecordCommand | Preview First Mail Merge Data Record Command. |
PreviewPreviousMailMergeDataRecordCommand | Preview Previous Mail Merge Data Record Command. |
PreviewNextMailMergeDataRecordCommand | Preview Next Mail Merge Data Record Command. |
PreviewLastMailMergeDataRecordCommand | Preview Last Mail Merge Data Record Command. |
InsertMergeFieldEmptyCommand | Insert Merge Field Empty Command. |
MailMergeCommand | Mail Merge Command. |
ToggleMergeFieldsHighlightCommand | Toggle Merge Fields Highlight Command. |
UpdateFieldCommand | Update Field Command. |
UpdateAllFieldsCommand | Update All Fields Command. |
RestartNumberingCommand | Restart Numbering Command. |
ContinueNumberingCommand | Continue Numbering Command. |
ChangeBibliographicStyleCommand | Change Bibliographic Style Command. |
ShowInsertDateTimeDialogCommand | Show Insert Date Time Dialog Command. |
ShowSetNumberingValueDialogCommand | Show Set Numbering Value Dialog Command. |
EditHeaderCommand | Edit Header Command. |
EditFooterCommand | Edit Footer Command. |
ChangeUnderlineColorCommand | Change Underline Color Command. |
ExitHeaderFooterEditModeCommand | Exit Header Footer Edit Mode Command. |
MoveSelectionCommand | Move Selection Command. |
ShowStyleFormattingPropertiesDialogCommand | Show Style Formatting Properties Dialog Command. |
ShowManageStylesDialogCommand | Show Manage Styles Dialog Command. |
InsertSdtCommand | Insert Sdt Command. |
ShowContentControlPropertiesDialogCommand | Show Content Control Properties Dialog Command. |
ShowDefineNewListStyleDialogCommand | Show Define New List Style Dialog Command. |
ToggleDocumentProtectionCommand | Toggle Document Protection Command. |
ShowChangeEditingPermissionsDialogCommand | Show Change Editing Permissions Dialog Command. |
ChangeStyleNameCommand | Change Style Name Command. |
ToggleHeaderFooterLinkToPreviousCommand | Toggle Header Footer Link To Previous Command. |
ShowWatermarkSettingsDialogCommand | Show Watermark Settings Dialog Command. |
ShowCodeFormattingDialogCommand | Show Code Formatting Dialog Command. |
DeleteCodeBlockCommand | Delete Code Block Command. |
RemoveWatermarkCommand | Remove Watermark Command. |
ChangeIntegratedWatermarkTypeCommand | Change Integrated Watermark Type Command. |
InsertFootnoteCommand | Insert Footnote Command. |
InsertEndnoteCommand | Insert Endnote Command. |
ShowNotesDialogCommand | Show Notes Dialog Command. |
GoToNextFootnoteCommand | Go To Next Footnote Command. |
GoToPreviousFootnoteCommand | Go To Previous Footnote Command. |
GoToNextEndnoteCommand | Go To Next Endnote Command. |
GoToPreviousEndnoteCommand | Go To Previous Endnote Command. |
IncrementPageWidthCommand | Increment Page Width Command. |
DecrementPageWidthCommand | Decrement Page Width Command. |
InsertLineNumberingCommand | Adds line numbering to the selected sections. |
SuppressLineNumberingForCurrentParagraphCommand | Disables the numbering for the currently selected paragraph(s). |
ShowLineNumberingDialogCommand | Opens the dialog enabling users to set different line numbering options. |
Here is an example with a RadToggleButton control.
private RadToggleButton boldButton;
public Commands()
{
this.InitializeComponent();
this.boldButton = new RadToggleButton();
this.boldButton.Text = "Bold";
this.boldButton.Click += this.boldButton_Click;
this.boldButton.Location = new Point(10, 10);
this.Controls.Add(this.boldButton);
}
private void boldButton_Click(object sender, EventArgs e)
{
this.radRichTextEditor1.Commands.ToggleBoldCommand.Execute();
}
Private boldButton As RadToggleButton
Public Sub New()
Me.InitializeComponent()
Me.boldButton = New RadToggleButton()
Me.boldButton.Text = "Bold"
AddHandler Me.boldButton.Click, AddressOf Me.boldButton_Click
Me.boldButton.Location = New Point(10, 10)
Me.Controls.Add(Me.boldButton)
End Sub
Private Sub boldButton_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.radRichTextEditor1.Commands.ToggleBoldCommand.Execute()
End Sub
Now, every time the button is clicked it will toggle the boldness of the current selection. The thing it won't do is to response to the current state of the selection. For example, if the context of the caret is a bold text, the button won't get automatically toggled. In order to implement this behavior you have to handle the ToggleStateChanged event of the ToggleBoldCommand. Here is an example.
private void Commands_Load(object sender, EventArgs e)
{
this.radRichTextEditor1.Commands.ToggleBoldCommand.ToggleStateChanged += this.ToggleBoldCommand_ToggleStateChanged;
}
public void ToggleBoldCommand_ToggleStateChanged(object sender, StylePropertyChangedEventArgs<bool> e)
{
this.boldButton.IsChecked = e.NewValue;
}
Private Sub Commands_Load(ByVal sender As Object, ByVal e As EventArgs)
AddHandler Me.radRichTextEditor1.Commands.ToggleBoldCommand.ToggleStateChanged, AddressOf Me.ToggleBoldCommand_ToggleStateChanged
End Sub
Public Sub ToggleBoldCommand_ToggleStateChanged(ByVal sender As Object, ByVal e As StylePropertyChangedEventArgs(Of Boolean))
Me.boldButton.IsChecked = e.NewValue
End Sub
Now, the button will respond to the current state of the selection.