skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class CellSelection

Represents a selection of cells.

Inheritance
System.Object
SelectionBase
CellSelection
Inherited Members
SelectionBase.BeginUpdate()
SelectionBase.EndUpdate()
SelectionBase.ExecuteForEachRangeInsideBeginEndUpdate(Action<CellRange>)
SelectionBase.ExecuteForEachRangeInsideBeginEndUpdate(IEnumerable<CellRange>, Action<CellRange>, Predicate<CellRange>)
SelectionBase.ExecuteForEachRange(Action<CellRange>)
SelectionBase.ExecuteForEachRange(IEnumerable<CellRange>, Action<CellRange>, Predicate<CellRange>)
SelectionBase.GetPropertyValue<T>(Func<CellRange, RangePropertyValue<T>>, IEnumerable<CellRange>, T)
SelectionBase.GetTopLeftCellIndex()
SelectionBase.Clear(ClearType)
SelectionBase.GetFormat()
SelectionBase.SetFormat(CellValueFormat)
SelectionBase.ClearFormat()
SelectionBase.GetStyleName()
SelectionBase.SetStyleName(String)
SelectionBase.ClearStyleName()
SelectionBase.GetFill()
SelectionBase.SetFill(IFill)
SelectionBase.ClearFill()
SelectionBase.GetFontFamily()
SelectionBase.SetFontFamily(ThemableFontFamily)
SelectionBase.ClearFontFamily()
SelectionBase.GetFontSize()
SelectionBase.SetFontSize(Double)
SelectionBase.ClearFontSize()
SelectionBase.GetIsBold()
SelectionBase.SetIsBold(Boolean)
SelectionBase.ClearIsBold()
SelectionBase.GetIsItalic()
SelectionBase.SetIsItalic(Boolean)
SelectionBase.ClearIsItalic()
SelectionBase.GetUnderline()
SelectionBase.SetUnderline(UnderlineType)
SelectionBase.ClearUnderline()
SelectionBase.GetForeColor()
SelectionBase.SetForeColor(ThemableColor)
SelectionBase.ClearForeColor()
SelectionBase.GetHorizontalAlignment()
SelectionBase.SetHorizontalAlignment(RadHorizontalAlignment)
SelectionBase.ClearHorizontalAlignment()
SelectionBase.GetVerticalAlignment()
SelectionBase.SetVerticalAlignment(RadVerticalAlignment)
SelectionBase.ClearVerticalAlignment()
SelectionBase.GetIndent()
SelectionBase.SetIndent(Int32)
SelectionBase.ClearIndent()
SelectionBase.IncreaseIndent()
SelectionBase.DecreaseIndent()
SelectionBase.GetIsWrapped()
SelectionBase.SetIsWrapped(Boolean)
SelectionBase.ClearIsWrapped()
SelectionBase.GetTextRotation()
SelectionBase.SetTextRotation(Int32)
SelectionBase.ClearTextRotation()
SelectionBase.GetBorders()
SelectionBase.ClearBorders()
SelectionBase.GetIsLocked()
SelectionBase.SetIsLocked(Boolean)
SelectionBase.ClearIsLocked()
SelectionBase.CellRanges
SelectionBase.Worksheet
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Documents.Spreadsheet.Model
Assembly: Telerik.Windows.Documents.Spreadsheet.dll

Syntax

public class CellSelection : SelectionBase

Methods

AddConditionalFormatting(ConditionalFormatting)

Adds a conditional formatting elemenet to the worksheet, applying it on the current selection ranges.

Declaration
public void AddConditionalFormatting(ConditionalFormatting formatting)
Parameters
ConditionalFormatting formatting

The added conditional formatting

CanCopy(WorksheetFragment)

Determines whether the specified fragment can be copied.

Declaration
public bool CanCopy(WorksheetFragment fragment)
Parameters
WorksheetFragment fragment

The fragment.

Returns
System.Boolean

The value indicating whether the specified fragment can be copied.

CanInsertOrRemove(CellRange, ShiftType)

Determines whether the selected range can be inserted or removed using the specified shift type.

Declaration
public bool CanInsertOrRemove(CellRange selectedRange, ShiftType shiftType)
Parameters
CellRange selectedRange

The selected range.

ShiftType shiftType

Type of the shift.

Returns
System.Boolean

The value indicating whether the selected range can be inserted or removed using the specified shift type.

CanPaste(WorksheetFragment)

Determines whether the specified fragment can be pasted.

Declaration
public PasteResult CanPaste(WorksheetFragment fragment)
Parameters
WorksheetFragment fragment

The fragment.

Returns
PasteResult

The paste result.

ClearDataValidationRule()

Clears the data validation rule.

Declaration
public void ClearDataValidationRule()

ClearValue()

Clears the value.

Declaration
public void ClearValue()

Copy()

Copies this instance.

Declaration
public WorksheetFragment Copy()
Returns
WorksheetFragment

The worksheet fragment.

FillData(FillDirection)

Fills data.

Declaration
public void FillData(FillDirection direction)
Parameters
FillDirection direction

The direction.

FillDataSeriesAuto(CellOrientation, Boolean, Nullable<Int32>)

Does auto data series fill.

Declaration
public void FillDataSeriesAuto(CellOrientation seriesOrientation, bool respectRangesDirection, int? initialValueCount = default(int? ))
Parameters
CellOrientation seriesOrientation

The series orientation.

System.Boolean respectRangesDirection

The respect ranges direction.

System.Nullable<System.Int32> initialValueCount

The initial value count.

FillDataSeriesDate(CellOrientation, DateUnitType, Double, Nullable<Double>)

Does date data series fill.

Declaration
public void FillDataSeriesDate(CellOrientation seriesOrientation, DateUnitType dateUnitType, double stepValue, double? stopValue = default(double? ))
Parameters
CellOrientation seriesOrientation

The series orientation.

DateUnitType dateUnitType

Type of the date unit.

System.Double stepValue

The step value.

System.Nullable<System.Double> stopValue

The stop value.

FillDataSeriesExponential(CellOrientation, Double, Nullable<Double>)

Does exponential data series fill.

Declaration
public void FillDataSeriesExponential(CellOrientation seriesOrientation, double stepValue, double? stopValue = default(double? ))
Parameters
CellOrientation seriesOrientation

The series orientation.

System.Double stepValue

The step value.

System.Nullable<System.Double> stopValue

The stop value.

FillDataSeriesExponentialTrend(CellOrientation)

Does exponential and trend data series fill.

Declaration
public void FillDataSeriesExponentialTrend(CellOrientation seriesOrientation)
Parameters
CellOrientation seriesOrientation

The series orientation.

FillDataSeriesLinear(CellOrientation, Double, Nullable<Double>)

Does linear data series fill.

Declaration
public void FillDataSeriesLinear(CellOrientation seriesOrientation, double stepValue, double? stopValue = default(double? ))
Parameters
CellOrientation seriesOrientation

The series orientation.

System.Double stepValue

The step value.

System.Nullable<System.Double> stopValue

The stop value.

FillDataSeriesLinearTrend(CellOrientation)

Does trend data series fill.

Declaration
public void FillDataSeriesLinearTrend(CellOrientation seriesOrientation)
Parameters
CellOrientation seriesOrientation

The series orientation.

Filter(IFilter[])

Sets the specified filters to the cell selection.

Declaration
public void Filter(params IFilter[] filters)
Parameters
IFilter[] filters

The filters.

GetConditionalFormattings()

Gets the conditional formatting elemenets that are active in the current selection.

Declaration
public IEnumerable<ConditionalFormattingRange> GetConditionalFormattings()
Returns
System.Collections.Generic.IEnumerable<ConditionalFormattingRange>

GetDataValidationRule()

Gets the data validation rule.

Declaration
public RangePropertyValue<IDataValidationRule> GetDataValidationRule()
Returns
RangePropertyValue<IDataValidationRule>

GetValue()

Gets the value.

Declaration
public RangePropertyValue<ICellValue> GetValue()
Returns
RangePropertyValue<ICellValue>

Returns the value of the selection.

Insert(InsertShiftType)

Inserts this instance using the specified shift type.

Declaration
public void Insert(InsertShiftType shiftType)
Parameters
InsertShiftType shiftType

Type of the shift.

Merge()

Merges this instance.

Declaration
public bool Merge()
Returns
System.Boolean

The value indicating whether the merge was successful.

MergeAcross()

Merges the instance across.

Declaration
public bool MergeAcross()
Returns
System.Boolean

The value indicating whether the merge was successful.

Paste(WorksheetFragment, PasteOptions)

Pastes the specified fragment.

Declaration
public bool Paste(WorksheetFragment fragment, PasteOptions pasteOptions)
Parameters
WorksheetFragment fragment

The fragment.

PasteOptions pasteOptions

The paste options.

Returns
System.Boolean

The value indicating whether the paste was successful.

Paste(WorksheetFragment, PasteOptions, out IEnumerable<CellRange>, out IEnumerable<FloatingShapeBase>)

Pastes the specified fragment.

Declaration
public bool Paste(WorksheetFragment fragment, PasteOptions pasteOptions, out IEnumerable<CellRange> affectedCellRanges, out IEnumerable<FloatingShapeBase> newShapes)
Parameters
WorksheetFragment fragment

The fragment.

PasteOptions pasteOptions

The paste options.

System.Collections.Generic.IEnumerable<CellRange> affectedCellRanges

The affected cell ranges.

System.Collections.Generic.IEnumerable<FloatingShapeBase> newShapes

The new shapes.

Returns
System.Boolean

The value indicating whether the paste was successful.

Paste(WorksheetFragment, PasteOptions, out IEnumerable<FloatingShapeBase>)

Pastes the specified fragment.

Declaration
public bool Paste(WorksheetFragment fragment, PasteOptions pasteOptions, out IEnumerable<FloatingShapeBase> newShapes)
Parameters
WorksheetFragment fragment

The fragment.

PasteOptions pasteOptions

The paste options.

System.Collections.Generic.IEnumerable<FloatingShapeBase> newShapes

The new shapes.

Returns
System.Boolean

Remove(RemoveShiftType)

Removes the instance using the specified shift type.

Declaration
public void Remove(RemoveShiftType shiftType)
Parameters
RemoveShiftType shiftType

Type of the shift.

RemoveConditionalFormatting(ConditionalFormatting)

Removes the a given formatting elemenets that is active in the current selection.

Declaration
public void RemoveConditionalFormatting(ConditionalFormatting formatting)
Parameters
ConditionalFormatting formatting

SetBorders(CellBorders)

Sets the borders.

Declaration
public override void SetBorders(CellBorders value)
Parameters
CellBorders value

The value.

Overrides
SelectionBase.SetBorders(CellBorders)

SetDataValidationRule(IDataValidationRule)

Sets the data validation rule.

Declaration
public void SetDataValidationRule(IDataValidationRule value)
Parameters
IDataValidationRule value

The value.

SetValue(Boolean)

Sets the value.

Declaration
public void SetValue(bool value)
Parameters
System.Boolean value

The value.

SetValue(DateTime)

Sets the value.

Declaration
public void SetValue(DateTime value)
Parameters
System.DateTime value

The value.

SetValue(Double)

Sets the value.

Declaration
public void SetValue(double value)
Parameters
System.Double value

The value.

SetValue(String)

Sets the value.

Declaration
public void SetValue(string value)
Parameters
System.String value

The value.

Remarks

Please note that the string value is parsed to find its type. This process is slow. If you know the type of your data use the other overloads of this method.

SetValue(ICellValue)

Sets the value.

Declaration
public void SetValue(ICellValue value)
Parameters
ICellValue value

The value.

SetValueAsFormula(String)

Sets the value as formula.

Declaration
public void SetValueAsFormula(string value)
Parameters
System.String value

The value.

SetValueAsText(String)

Sets the value as text.

Declaration
public void SetValueAsText(string value)
Parameters
System.String value

The value.

Sort(ISortCondition[])

Sorts the selected cells using the specified sort conditions.

Declaration
public void Sort(params ISortCondition[] sortConditions)
Parameters
ISortCondition[] sortConditions

The sort conditions.

Unmerge()

Unmerges this instance.

Declaration
public void Unmerge()
Getting Started
  • Getting Started
Support Resources
  • Documentation
Community
  • Forums
  • Blogs
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.