Show / Hide Table of Contents

Class Range

Represents a set of cells in a sheet.

Inheritance
System.Object
Range
CompositeRange
SimpleRange
Implements
IEnumerable<System.Object>
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public abstract class Range : INotifyPropertyChanged, IRange, IArray, IEnumerable<object>, ICellEnumerator

Constructors

Range()

Declaration
protected Range()

Properties

AbsoluteLabel

Declaration
public string AbsoluteLabel { get; }
Property Value
Type Description
System.String

Background

Get or set the background of the range.

Declaration
public CellFill Background { get; set; }
Property Value
Type Description
CellFill

CellCount

Declaration
public int CellCount { get; }
Property Value
Type Description
System.Int32

ColumnCount

Gets the count of columns of the range.

Declaration
public abstract int ColumnCount { get; }
Property Value
Type Description
System.Int32

Fill

Gets the fill for a Range.

Declaration
public RangeFill Fill { get; }
Property Value
Type Description
RangeFill

FirstColumnIndex

Gets the first column index of the range.

Declaration
public virtual int FirstColumnIndex { get; }
Property Value
Type Description
System.Int32

FirstRowIndex

Gets the first row index of the range.

Declaration
public virtual int FirstRowIndex { get; }
Property Value
Type Description
System.Int32

Font

Declaration
public RangeFont Font { get; }
Property Value
Type Description
RangeFont

Foreground

Get or set the foregroung color of the range.

Declaration
public SpreadsheetColor Foreground { get; set; }
Property Value
Type Description
SpreadsheetColor

Format

Get or set the format for this range.

Declaration
public Format Format { get; set; }
Property Value
Type Description
Format

FullAbsoluteLabel

Declaration
public string FullAbsoluteLabel { get; }
Property Value
Type Description
System.String

FullLabel

Declaration
public string FullLabel { get; }
Property Value
Type Description
System.String

HorizontalAlignment

Declaration
public HorizontalCellAlignment? HorizontalAlignment { get; set; }
Property Value
Type Description
System.Nullable<HorizontalCellAlignment>

IsFullColumn

Declaration
public abstract bool IsFullColumn { get; }
Property Value
Type Description
System.Boolean

IsFullRow

Declaration
public abstract bool IsFullRow { get; }
Property Value
Type Description
System.Boolean

IsLocked

Set or get whether the cell is locked and cannot be edited. This value of this property is meaningful only if the sheet is protected.

Declaration
public bool? IsLocked { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

Item[Int32]

Gets a cell from a range with the specified index.

Declaration
public Cell this[int index] { get; }
Parameters
Type Name Description
System.Int32 index
Property Value
Type Description
Cell

Item[Int32, Int32]

Declaration
public abstract Cell this[int row, int column] { get; }
Parameters
Type Name Description
System.Int32 row
System.Int32 column
Property Value
Type Description
Cell

Label

Declaration
public abstract string Label { get; }
Property Value
Type Description
System.String

NameOrLabel

Declaration
public string NameOrLabel { get; }
Property Value
Type Description
System.String

RowCount

Gets the count of rows of the range.

Declaration
public abstract int RowCount { get; }
Property Value
Type Description
System.Int32

TopLeftCell

Get the cell in the top left corner of the range

Declaration
public abstract Cell TopLeftCell { get; }
Property Value
Type Description
Cell

VerticalAlignment

Get or set the vertical of cells in this range.

Declaration
public VerticalCellAlignment? VerticalAlignment { get; set; }
Property Value
Type Description
System.Nullable<VerticalCellAlignment>

Worksheet

Get the sheet which contains this range.

Declaration
public abstract Worksheet Worksheet { get; }
Property Value
Type Description
Worksheet

WrapText

Get or set the text wrapping of cells in this range.

Declaration
public bool? WrapText { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

Methods

Clear()

Clear all content and formatting from the range.

Declaration
public void Clear()

ClearBorders()

Clear all borders from the range

Declaration
public void ClearBorders()

ClearComments()

Clear all the comments from the range

Declaration
public void ClearComments()

ClearContents()

Clear the values and formula from the range

Declaration
public void ClearContents()

ClearFormats()

Clear all formats from the range

Declaration
public void ClearFormats()

ClearHyperlinks()

Clear all hyperlinks from the range.

Declaration
public void ClearHyperlinks()

CopyFrom(Range, PasteOptions)

Declaration
public void CopyFrom(Range source, PasteOptions pasteOptions)
Parameters
Type Name Description
Range source
PasteOptions pasteOptions

Equals(Range)

Declaration
public virtual bool Equals(Range r)
Parameters
Type Name Description
Range r
Returns
Type Description
System.Boolean

FindAll(FindArguments)

Declaration
public IEnumerable<Cell> FindAll(FindArguments arguments)
Parameters
Type Name Description
FindArguments arguments
Returns
Type Description
IEnumerable<Cell>

GetAllCells()

Enumerates all the cells in the current range

Declaration
public abstract IEnumerable<Cell> GetAllCells()
Returns
Type Description
IEnumerable<Cell>

The cells

GetColumns()

Declaration
public abstract IEnumerable<Column> GetColumns()
Returns
Type Description
IEnumerable<Column>

GetRows()

Declaration
public abstract IEnumerable<Row> GetRows()
Returns
Type Description
IEnumerable<Row>

Intersection(Range, Range)

Gets the intersection of two ranges.

Declaration
public static Range Intersection(Range range1, Range range2)
Parameters
Type Name Description
Range range1
Range range2
Returns
Type Description
Range

Intersects(Range, Range)

Declaration
public static bool Intersects(Range range1, Range range2)
Parameters
Type Name Description
Range range1
Range range2
Returns
Type Description
System.Boolean

Merge()

Merges the cells in the range.

Declaration
public void Merge()

ReplaceAll(ReplaceArguments)

Declaration
public void ReplaceAll(ReplaceArguments arguments)
Parameters
Type Name Description
ReplaceArguments arguments

SetArrayFormula(String)

Set the array formula of the range.

Declaration
public void SetArrayFormula(string text)
Parameters
Type Name Description
System.String text

The text of the array formula. The text of the formula should not be localized

SetArrayFormula(String, Boolean)

Set the array formula of the range.

Declaration
public void SetArrayFormula(string text, bool localized)
Parameters
Type Name Description
System.String text

The text of the array formula

System.Boolean localized

Specifies whether the text is localized

SetBorder(Border, BorderType)

Set the border for a given range edge

Declaration
public abstract void SetBorder(Border border, BorderType borderType)
Parameters
Type Name Description
Border border

The value of the border to set

BorderType borderType

The type of border to set

SetColumnsWidthPixel(Double)

Declaration
public virtual void SetColumnsWidthPixel(double w)
Parameters
Type Name Description
System.Double w

SetFormula(String)

Declaration
public void SetFormula(string formula)
Parameters
Type Name Description
System.String formula

SetFormula(String[])

Declaration
public void SetFormula(string[] formulas)
Parameters
Type Name Description
System.String[] formulas

SetRowsHeight(Double)

Declaration
public virtual void SetRowsHeight(double value)
Parameters
Type Name Description
System.Double value

SetStyle(CellStyle)

Set the style of the range. This method extracts the properties of the style and applies them to all cells and dimensions in the current range.

Declaration
public abstract void SetStyle(CellStyle style)
Parameters
Type Name Description
CellStyle style

The style to apply

SetValue(DateTime[])

Declaration
public void SetValue(DateTime[] values)
Parameters
Type Name Description
DateTime[] values

SetValue(ErrorType[])

Declaration
public void SetValue(ErrorType[] values)
Parameters
Type Name Description
ErrorType[] values

SetValue(Double[])

Declaration
public void SetValue(double[] values)
Parameters
Type Name Description
System.Double[] values

SetValue(Int32[])

Declaration
public void SetValue(int[] values)
Parameters
Type Name Description
System.Int32[] values

SetValue(Object)

Declaration
public void SetValue(object value)
Parameters
Type Name Description
System.Object value

SetValue(Object[])

Declaration
public void SetValue(object[] values)
Parameters
Type Name Description
System.Object[] values

SetValue(Object[,])

Declaration
public void SetValue(object[, ] values)
Parameters
Type Name Description
System.Object[,] values

Sort()

Sort the row values in ascending order. Top-Down.

Declaration
public void Sort()

Sort(SortOrder)

Declaration
public void Sort(SortOrder order)
Parameters
Type Name Description
SortOrder order

Sort(SortOrder, SortOrientation)

Declaration
public void Sort(SortOrder order, SortOrientation orientation)
Parameters
Type Name Description
SortOrder order
SortOrientation orientation

ToString()

Declaration
public override sealed string ToString()
Returns
Type Description
System.String

Union(Range, Range)

Declaration
public static Range Union(Range range1, Range range2)
Parameters
Type Name Description
Range range1
Range range2
Returns
Type Description
Range

Events

PropertyChanged

Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type Description
PropertyChangedEventHandler

Implements

IEnumerable<>
Back to top Generated by DocFX