SelectionBase
Abstract base for range-based selections in worksheets, providing property access and modification methods for formatting, borders, and values across one or more cell ranges.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.Model
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public abstract class SelectionBase
Inheritance: objectSelectionBase
Derived Classes:
Methods
Suspends layout recalculation and starts an undo group, enabling efficient batch modifications across the selection.
protected void BeginUpdate()
Clears content, formatting, or both from the selection based on the specified clear type.
Removes all borders from the selection, including outer, inner, and diagonal borders.
public void ClearBorders()
Removes the background fill from the selection, reverting to no fill.
public void ClearFill()
Removes the font family from the selection, reverting to the default font.
public void ClearFontFamily()
Removes the font size from the selection, reverting to the default size.
public void ClearFontSize()
Removes the text color from the selection, reverting to the default color.
public void ClearForeColor()
Removes the number format from the selection, reverting to the default format.
public void ClearFormat()
Removes the horizontal alignment from the selection, reverting to the default alignment.
public void ClearHorizontalAlignment()
Removes the indentation from the selection, reverting to zero indent.
public void ClearIndent()
Removes the bold formatting from the selection, reverting to the default weight.
public void ClearIsBold()
Removes the italic formatting from the selection, reverting to the default style.
public void ClearIsItalic()
Removes the lock setting from the selection, reverting to the default locked state.
public void ClearIsLocked()
Removes the strikethrough formatting from the selection, reverting to no strikethrough.
public void ClearIsStrikethrough()
Removes the text wrapping setting from the selection, reverting to the default behavior.
public void ClearIsWrapped()
Removes the named style reference from the selection, reverting to the default style.
public void ClearStyleName()
Removes the text rotation from the selection, reverting to zero degrees.
public void ClearTextRotation()
Removes the underline style from the selection, reverting to no underline.
public void ClearUnderline()
Removes the vertical alignment from the selection, reverting to the default alignment.
public void ClearVerticalAlignment()
Removes the vertical text alignment from the selection, reverting to baseline.
public void ClearVerticalTextAlignment()
Decreases the indentation level by one for the selection, ensuring compatible horizontal alignment and stopping at zero.
public void DecreaseIndent()
Resumes layout recalculation and closes the undo group, completing the batch modification initiated by BeginUpdate.
protected void EndUpdate()
Executes the specified action on each provided range, optionally checking a predicate before proceeding, and returns whether all ranges passed the predicate.
Executes the specified action on each provided range within a suspended-update context, optionally checking a predicate before proceeding, and returns whether all ranges passed the predicate.
protected bool ExecuteForEachRangeInsideBeginEndUpdate(IEnumerable<CellRange> cellRanges, Action<CellRange> action, Predicate<CellRange> canExecute = null)
The cell ranges.
actionAction<CellRange>The action.
canExecutePredicate<CellRange>The can execute.
Returns:Retrieves all border styles applied to the selection, including outer, inner, and diagonal borders, resolving conflicts by priority.
Retrieves the background fill applied to the selection, or an indeterminate state if fills differ.
public RangePropertyValue<IFill> GetFill()
The fill value for the selection.
Retrieves the font family applied to the selection, which may reference a theme font or explicit typeface.
public RangePropertyValue<ThemableFontFamily> GetFontFamily()
RangePropertyValue<ThemableFontFamily>
The font family for the selection.
Retrieves the font size in device-independent units from the selection.
public RangePropertyValue<double> GetFontSize()
The font size for the selection.
Retrieves the text color applied to the selection, which may reference a theme color or explicit RGB value.
public RangePropertyValue<ThemableColor> GetForeColor()
RangePropertyValue<ThemableColor>
The font color for the selection.
Retrieves the number format pattern applied to the selection, or an indeterminate state if formats differ.
public RangePropertyValue<CellValueFormat> GetFormat()
RangePropertyValue<CellValueFormat>
The format for the selection.
Retrieves the horizontal text alignment applied to the selection.
public RangePropertyValue<RadHorizontalAlignment> GetHorizontalAlignment()
RangePropertyValue<RadHorizontalAlignment>
The horizontal alignment for the selection.
Retrieves the text indentation level applied to the selection, measured in indent units.
public RangePropertyValue<int> GetIndent()
The indent for the selection.
Checks whether bold formatting is applied to the selection.
public RangePropertyValue<bool> GetIsBold()
The value indicating whether the font is bold for the selection.
Checks whether italic formatting is applied to the selection.
public RangePropertyValue<bool> GetIsItalic()
The value indicating whether the font is italic for the selection.
Checks whether the selection is locked for editing when worksheet protection is enabled.
public RangePropertyValue<bool> GetIsLocked()
The value indicating whether the selection is locked.
Checks whether strikethrough formatting is applied to the selection.
public RangePropertyValue<bool> GetIsStrikethrough()
The value indicating whether the font is strikethrough for the selection.
Checks whether text wrapping is enabled for the selection.
public RangePropertyValue<bool> GetIsWrapped()
The value indicating whether text wrapping is used.
Retrieves a property value from the specified ranges, returning either a consistent value or an indeterminate state if values differ across ranges.
protected RangePropertyValue<T> GetPropertyValue<T>(Func<CellRange, RangePropertyValue<T>> getRangePropertyValue, IEnumerable<CellRange> cellRanges, T defaultValue)
The get range property value.
cellRangesIEnumerable<CellRange>The cell ranges.
defaultValueTThe default value.
Returns:Retrieves the named cell style applied to the selection, or an indeterminate state if styles differ.
public RangePropertyValue<string> GetStyleName()
The name of the style for the selection.
Retrieves the text rotation angle applied to the selection, measured in degrees from -90 to 90.
public RangePropertyValue<int> GetTextRotation()
The text rotation degree for the selection in range -90 to 90.
Finds and returns the top-left cell index across all ranges in the selection.
Retrieves the underline style applied to the selection.
public RangePropertyValue<UnderlineType> GetUnderline()
RangePropertyValue<UnderlineType>
The underline property for the selection.
Retrieves the vertical text alignment applied to the selection.
public RangePropertyValue<RadVerticalAlignment> GetVerticalAlignment()
RangePropertyValue<RadVerticalAlignment>
The vertical alignment for the selection.
Checks the vertical text alignment (none, superscript, or subscript) applied to the selection.
public RangePropertyValue<VerticalTextAlignment> GetVerticalTextAlignment()
RangePropertyValue<VerticalTextAlignment>
The vertical text alignment for the selection.
Increases the indentation level by one for the selection, ensuring compatible horizontal alignment and respecting the maximum indent limit.
public void IncreaseIndent()
Applies the specified border configuration to the selection, supporting outer, inner, and diagonal borders.
Applies the specified background fill (solid, pattern, or gradient) to the selection.
Applies the specified font family to the selection, supporting both theme-based and explicit font references.
Applies the specified font size to the selection, which must be between 1 and 409 points.
Applies the specified text color to the selection, supporting both theme-based and explicit color references.
Applies the specified number format pattern to the selection and updates cell values to respect the new format.
Applies the specified horizontal alignment to the selection, clearing indent if the alignment is incompatible.
public void SetHorizontalAlignment(RadHorizontalAlignment value)
The value.
Applies the specified indentation level to the selection, which must be between 0 and 250, and ensures compatible horizontal alignment.
Applies or removes bold formatting on the selection.
Applies or removes italic formatting on the selection.
Locks or unlocks the selection for editing when worksheet protection is enabled.
Applies or removes strikethrough formatting on the selection.
Enables or disables text wrapping for the selection.
Applies the specified named cell style to the selection, clearing locally-set properties that conflict with the style definition.
Applies the specified rotation angle to the selection, which must be between -90 and 90 degrees.
public void SetTextRotation(int value)
The rotation degree in the range -90 to 90.
Applies the specified underline style to the selection.
Applies the specified vertical alignment to the selection.
public void SetVerticalAlignment(RadVerticalAlignment value)
The value.
Applies vertical text alignment (none, superscript, or subscript) to the selection.
public void SetVerticalTextAlignment(VerticalTextAlignment value)
The value.
Properties
The collection of cell ranges included in this selection.
public IEnumerable<CellRange> CellRanges { get; }
The cell ranges.