• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class CompositeRange

Represents a range composed of multiple simple ranges that may be non-contiguous.

Inheritance
object
Range
CompositeRange
Implements
INotifyPropertyChanged
IEnumerable<object>
IEnumerable
Inherited Members
Range.Sort()
Range.Sort(SortOrder)
Range.Sort(SortOrder, SortOrientation)
Range.ToString()
Range.ClearBorders()
Range.SetArrayFormula(string, bool)
Range.SetArrayFormula(string)
Range.FindAll(FindArguments)
Range.ReplaceAll(ReplaceArguments)
Range.CopyFrom(Range, PasteOptions)
Range.Intersects(Range, Range)
Range.ClearFormats()
Range.Clear()
Range.ClearContents()
Range.ClearComments()
Range.ClearHyperlinks()
Range.Merge()
Range.Union(Range, Range)
Range.Intersection(Range, Range)
Range.SetColumnsWidthPixel(double)
Range.SetRowsHeight(double)
Range.SetFormula(string)
Range.SetFormula(string[])
Range.SetValue(object)
Range.SetValue(object[,])
Range.SetValue(object[])
Range.SetValue(DateTime[])
Range.SetValue(double[])
Range.SetValue(int[])
Range.SetValue(ErrorType[])
Range.RemoveDuplicates(RemoveDuplicatesOptions)
Range.DeleteEmptyRows(DeleteEmptyRowsOptions)
Range.DeleteEmptyColumns(DeleteEmptyColumnsOptions)
Range.CleanText(TextCleansingOptions)
Range.NameOrLabel
Range.this[int]
Range.FirstRowIndex
Range.FirstColumnIndex
Range.Foreground
Range.Background
Range.WrapText
Range.VerticalAlignment
Range.HorizontalAlignment
Range.Format
Range.IsLocked
Range.AbsoluteLabel
Range.FullAbsoluteLabel
Range.FullLabel
Range.CellCount
Range.Fill
Range.Font
Range.PropertyChanged
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class CompositeRange : Range, INotifyPropertyChanged, IEnumerable<object>, IEnumerable
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

Examples
// Create a composite range from two separate cell ranges
var range1 = worksheet.Cells["A1:B2"];
var range2 = worksheet.Cells["D4:E5"];
var composite = new CompositeRange(new[] { range1, range2 });

Constructors

CompositeRange(IEnumerable<SimpleRange>)

Initializes a new CompositeRange from the specified collection of simple ranges.

Declaration
public CompositeRange(IEnumerable<SimpleRange> ranges)
Parameters
Type Name Description
IEnumerable<SimpleRange> ranges

The collection of simple ranges that compose this range.

Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

Exceptions
Type Condition
ArgumentException

Thrown when ranges is null or contains null elements.

Properties

ColumnCount

Gets the number of columns in the first constituent range.

Declaration
public override int ColumnCount { get; }
Property Value
Type Description
int
Overrides
Range.ColumnCount
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

IsFullColumn

Gets a value indicating whether this range represents a full column.

Declaration
public override bool IsFullColumn { get; }
Property Value
Type Description
bool
Overrides
Range.IsFullColumn
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

IsFullRow

Gets a value indicating whether this range represents a full row.

Declaration
public override bool IsFullRow { get; }
Property Value
Type Description
bool
Overrides
Range.IsFullRow
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

this[int, int]

Gets the cell at the specified row and column indices.

Declaration
public override Cell this[int row, int column] { get; }
Parameters
Type Name Description
int row

The row index.

int column

The column index.

Property Value
Type Description
Cell

The cell at the specified position.

Overrides
Range.this[int, int]
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

Exceptions
Type Condition
NotImplementedException

This property is not supported for composite ranges.

Label

Gets the label representation of this composite range.

Declaration
public override string Label { get; }
Property Value
Type Description
string
Overrides
Range.Label
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

Ranges

Gets the list of simple ranges that compose this composite range.

Declaration
public List<SimpleRange> Ranges { get; }
Property Value
Type Description
List<SimpleRange>
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

RowCount

Gets the number of rows in the first constituent range.

Declaration
public override int RowCount { get; }
Property Value
Type Description
int
Overrides
Range.RowCount
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

TopLeftCell

Gets the top-left cell of the first constituent range.

Declaration
public override Cell TopLeftCell { get; }
Property Value
Type Description
Cell
Overrides
Range.TopLeftCell
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

Worksheet

Gets the worksheet containing this composite range.

Declaration
public override Worksheet Worksheet { get; }
Property Value
Type Description
Worksheet
Overrides
Range.Worksheet
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

Methods

Equals(Range)

Determines whether this composite range equals another range.

Declaration
public override bool Equals(Range r)
Parameters
Type Name Description
Range r

The range to compare with.

Returns
Type Description
bool

true if the ranges are equal; otherwise, false.

Overrides
Range.Equals(Range)
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

GetAllCells()

Gets all cells in this composite range.

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

An enumerable of all cells across all constituent ranges.

Overrides
Range.GetAllCells()
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

GetColumns()

Gets the distinct columns spanned by this composite range.

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

An enumerable of distinct columns.

Overrides
Range.GetColumns()
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

GetRows()

Gets the distinct rows spanned by this composite range.

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

An enumerable of distinct rows.

Overrides
Range.GetRows()
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

SetBorder(Border, BorderType)

Sets the border for all constituent ranges in this composite range.

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

The border to apply.

BorderType borderType

The type of border to set.

Overrides
Range.SetBorder(Border, BorderType)
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

SetStyle(CellStyle)

Sets the cell style for all constituent ranges in this composite range.

Declaration
public override void SetStyle(CellStyle cellStyle)
Parameters
Type Name Description
CellStyle cellStyle

The cell style to apply.

Overrides
Range.SetStyle(CellStyle)
Remarks

CompositeRange is used when a range operation needs to span multiple disjoint areas. For example, when a user selects multiple non-contiguous ranges, they are represented as a composite range.

This class inherits from Range and provides implementations that delegate operations to each constituent simple range.

Implements

INotifyPropertyChanged
IEnumerable<T>
IEnumerable

Extension Methods

SortingExtensions.Sort(Range, bool)
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX