ClassCellSelection
Provides operations on a selection of one or more cell ranges, enabling batch setting of values, formatting, formulas, and data validation.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.Model
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public class CellSelection : SelectionBase
Inheritance: objectSelectionBaseCellSelection
Inherited Members
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
formatting
The added conditional formatting
CanCopy(WorksheetFragment)
Determines whether the specified fragment can be copied.
Declaration
public bool CanCopy(WorksheetFragment fragment)
Parameters
fragment
The fragment.
Returns
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
selectedRange
The selected range.
shiftType
Type of the shift.
Returns
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
fragment
The fragment.
Returns
The paste result.
ClearDataValidationRule()
Clears the data validation rule.
Declaration
public void ClearDataValidationRule()
Copy()
Copies this instance.
Declaration
public WorksheetFragment Copy()
Returns
The worksheet fragment.
FillData(FillDirection)
Fills data.
Declaration
public void FillData(FillDirection direction)
Parameters
direction
The direction.
FillDataSeriesAuto(CellOrientation, bool, int?)
Does auto data series fill.
Declaration
public void FillDataSeriesAuto(CellOrientation seriesOrientation, bool respectRangesDirection, int? initialValueCount = null)
Parameters
seriesOrientation
The series orientation.
respectRangesDirection
The respect ranges direction.
initialValueCount
int?
The initial value count.
FillDataSeriesDate(CellOrientation, DateUnitType, double, double?)
Does date data series fill.
Declaration
public void FillDataSeriesDate(CellOrientation seriesOrientation, DateUnitType dateUnitType, double stepValue, double? stopValue = null)
Parameters
seriesOrientation
The series orientation.
dateUnitType
Type of the date unit.
stepValue
The step value.
stopValue
The stop value.
FillDataSeriesExponential(CellOrientation, double, double?)
Does exponential data series fill.
Declaration
public void FillDataSeriesExponential(CellOrientation seriesOrientation, double stepValue, double? stopValue = null)
Parameters
seriesOrientation
The series orientation.
stepValue
The step value.
stopValue
The stop value.
FillDataSeriesExponentialTrend(CellOrientation)
Does exponential and trend data series fill.
Declaration
public void FillDataSeriesExponentialTrend(CellOrientation seriesOrientation)
Parameters
seriesOrientation
The series orientation.
FillDataSeriesLinear(CellOrientation, double, double?)
Does linear data series fill.
Declaration
public void FillDataSeriesLinear(CellOrientation seriesOrientation, double stepValue, double? stopValue = null)
Parameters
seriesOrientation
The series orientation.
stepValue
The step value.
stopValue
The stop value.
FillDataSeriesLinearTrend(CellOrientation)
Does trend data series fill.
Declaration
public void FillDataSeriesLinearTrend(CellOrientation seriesOrientation)
Parameters
seriesOrientation
The series orientation.
Filter(params IFilter[])
Sets the specified filters to the cell selection.
Declaration
public void Filter(params IFilter[] filters)
Parameters
filters
IFilter[]
The filters.
GetConditionalFormattings()
Gets the conditional formatting elemenets that are active in the current selection.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Formattings")]
public IEnumerable<ConditionalFormattingRange> GetConditionalFormattings()
Returns
GetDataValidationRule()
Gets the data validation rule.
Declaration
public RangePropertyValue<IDataValidationRule> GetDataValidationRule()
Returns
GetValue()
Retrieves the cell value(s) from the selection, returning a single value if uniform or an indeterminate result if mixed.
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
shiftType
Type of the shift.
Merge()
Merges this instance.
Declaration
public bool Merge()
Returns
The value indicating whether the merge was successful.
MergeAcross()
Merges the instance across.
Declaration
public bool MergeAcross()
Returns
The value indicating whether the merge was successful.
Paste(WorksheetFragment, PasteOptions)
Pastes the specified fragment.
Declaration
public bool Paste(WorksheetFragment fragment, PasteOptions pasteOptions)
Parameters
fragment
The fragment.
pasteOptions
The paste options.
Returns
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
fragment
The fragment.
pasteOptions
The paste options.
affectedCellRanges
The affected cell ranges.
newShapes
IEnumerable<FloatingShapeBase>
The new shapes.
Returns
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
fragment
The fragment.
pasteOptions
The paste options.
newShapes
IEnumerable<FloatingShapeBase>
The new shapes.
Returns
Remove(RemoveShiftType)
Removes the instance using the specified shift type.
Declaration
public void Remove(RemoveShiftType shiftType)
Parameters
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
formatting
SetBorders(CellBorders)
Sets the borders.
Declaration
public override void SetBorders(CellBorders value)
Parameters
value
The value.
Overrides
SetDataValidationRule(IDataValidationRule)
Sets the data validation rule.
Declaration
public void SetDataValidationRule(IDataValidationRule value)
Parameters
value
The value.
SetValue(DateTime)
Sets all cells in the selection to the specified date-time value and applies short date formatting if the cell format is default.
Declaration
public void SetValue(DateTime value)
Parameters
value
The value.
SetValue(ICellValue)
Sets the value.
Declaration
public void SetValue(ICellValue value)
Parameters
value
The value.
SetValue(bool)
Sets all cells in the selection to the specified boolean value.
SetValue(double)
Sets all cells in the selection to the specified numeric value.
SetValue(string)
Parses and sets the string value for all cells in the selection; prefer typed overloads for better performance.
Declaration
public void SetValue(string value)
Parameters
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.
SetValueAsFormula(string)
Sets all cells in the selection to the specified formula string, which will calculate dynamically.
Declaration
public void SetValueAsFormula(string value)
Parameters
value
The value.
SetValueAsText(string)
Sets all cells in the selection to the specified value as literal text, bypassing number and formula parsing.
Declaration
public void SetValueAsText(string value)
Parameters
value
The value.
Sort(params ISortCondition[])
Sorts the selected cells using the specified sort conditions.
Declaration
public void Sort(params ISortCondition[] sortConditions)
Parameters
sortConditions
The sort conditions.