New to Telerik UI for WinForms? Start a free 30-day trial

Changes horizontal and vertical alignment for table-cell content and reports the current alignment state.

Definition

Constructors

Initializes the command for the specified editor.

C#
public TableCellContentAlignmentCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The rich text box containing the table cells.

Properties

Allows the command to remain enabled when the selection contains only table cells.

C#
protected override bool IsTableSelectionEnabledCommand { get; }

Overrides: TableContextCommandBase.IsTableSelectionEnabledCommand

Methods

Applies the horizontal and vertical alignments specified by a supported parameter.

C#
protected override void ExecuteOverride(object parameter)
Parameters:parameterobject

An alignment parameter object or a parser-accepted pair of alignment names.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)

Creates event data from the last cached alignment and the current cell's stored alignments.

C#
public StylePropertyChangedEventArgs<TableCellContentAlignmentCommandParameter> GetEventArgs()
Returns:

StylePropertyChangedEventArgs<TableCellContentAlignmentCommandParameter>

The cached and current alignment values.

Raises the CellContentAlignmentChanged event.

C#
protected virtual void OnCellContentAlignmentChanged(StylePropertyChangedEventArgs<TableCellContentAlignmentCommandParameter> e)
Parameters:eStylePropertyChangedEventArgs<TableCellContentAlignmentCommandParameter>

The old and new alignment values.

Attempts to read horizontal and vertical alignment values from a parameter object or string.

C#
public static bool TryConvertCommandParameter(object commandParameter, out RadTextAlignment textAlignment, out RadVerticalAlignment verticalAlignment)
Parameters:commandParameterobject

A TableCellContentAlignmentCommandParameter or two parser-accepted enum names separated by a space or comma.

textAlignmentRadTextAlignment

Receives the horizontal text alignment.

verticalAlignmentRadVerticalAlignment

Receives the vertical content alignment.

Returns:

bool

true when the parameter is converted; otherwise, false.

Does nothing because cell-context notifications update this command's alignment state.

C#
protected override void UpdateSpanStyle()

Overrides: RichTextBoxCommandBase.UpdateSpanStyle()

Events

Occurs when the observed cell alignment changes. Reapplying the current alignment also raises the event so bound controls can resynchronize.

C#
public event EventHandler<StylePropertyChangedEventArgs<TableCellContentAlignmentCommandParameter>> CellContentAlignmentChanged