Class UnionRange
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Represents union range.
public class UnionRange
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
CellCount
Gets all cell count in the range.
public int CellCount { get; }
Property Value
ColumnCount
Gets the count of rows in the range.
public int ColumnCount { get; }
Property Value
Remarks
Only effects when it only contains one range.
FirstColumn
Gets the index of the first column of the range.
public int FirstColumn { get; }
Property Value
Remarks
Only effects when it only contains one range.
FirstRow
Gets the index of the first row of the range.
public int FirstRow { get; }
Property Value
Remarks
Only effects when it only contains one range.
HasRange
Indicates whether this has range.
public bool HasRange { get; }
Property Value
Hyperlinks
Gets all hyperlink in the range.
public Hyperlink[] Hyperlinks { get; }
Property Value
Name
Gets or sets the name of the range.
public string Name { get; set; }
Property Value
Remarks
Named range is supported. For example,
range.Name = “Sheet1!MyRange”;
RangeCount
Gets the count of the ranges.
public int RangeCount { get; }
Property Value
Ranges
Gets all union ranges.
public Range[] Ranges { get; }
Property Value
Range[]
RefersTo
Gets the range’s refers to.
public string RefersTo { get; }
Property Value
RowCount
Gets the count of rows in the range.
public int RowCount { get; }
Property Value
Remarks
Only effects when it only contains one range.
Value
Gets and sets the values of the range.
public object Value { get; set; }
Property Value
Methods
ApplyStyle(Style, StyleFlag)
Applies formats for a whole range.
public void ApplyStyle(Style style, StyleFlag flag)
Parameters
style
Style
The style object which will be applied.
flag
StyleFlag
Flags which indicates applied formatting properties.
Remarks
Each cell in this range will contains a Aspose.Cells.Style object. So this is a memory-consuming method. Please use it carefully.
Copy(UnionRange, PasteOptions)
Copying the range with paste special options.
public void Copy(UnionRange range, PasteOptions options)
Parameters
range
UnionRange
The source range.
options
PasteOptions
The paste special options.
GetEnumerator()
Gets the enumerator for cells in this Range.
public IEnumerator GetEnumerator()
Returns
The cells enumerator
Remarks
When traversing elements by the returned Enumerator, the cells collection should not be modified(such as operations that will cause new Cell/Row be instantiated or existing Cell/Row be deleted). Otherwise the enumerator may not be able to traverse all cells correctly(some elements may be traversed repeatedly or skipped).
Intersect(string)
Intersects another range.
public UnionRange Intersect(string range)
Parameters
range
string
The range.
Returns
Remarks
If the two union ranges are not intersected, returns null.
Intersect(UnionRange)
Intersects another range.
public UnionRange Intersect(UnionRange unionRange)
Parameters
unionRange
UnionRange
The range.
Returns
Remarks
If the two union ranges are not intersected, returns null.
Intersect(Range[])
Intersects another range.
public UnionRange Intersect(Range[] ranges)
Parameters
ranges
Range[]
The range.
Returns
Remarks
If the two union ranges are not intersected, returns null.
Merge()
Combines a range of cells into a single cell.
public void Merge()
Remarks
Reference the merged cell via the address of the upper-left cell in the range.
PutValue(string, bool, bool)
Puts a value into the range, if appropriate the value will be converted to other data type and cell’s number format will be reset.
public void PutValue(string stringValue, bool isConverted, bool setStyle)
Parameters
stringValue
string
Input value
isConverted
bool
True: converted to other data type if appropriate.
setStyle
bool
True: set the number format to cell’s style when converting to other data type
SetOutlineBorders(CellBorderType[], Color[])
Sets out line borders around a range of cells.
public void SetOutlineBorders(CellBorderType[] borderStyles, Color[] borderColors)
Parameters
borderStyles
CellBorderType[]
Border styles.
borderColors
Color[]
Border colors.
Remarks
Both the length of borderStyles and borderStyles must be 4. The order of borderStyles and borderStyles must be top,bottom,left,right
SetOutlineBorders(CellBorderType, Color)
Sets the outline borders around a range of cells with same border style and color.
public void SetOutlineBorders(CellBorderType borderStyle, Color borderColor)
Parameters
borderStyle
CellBorderType
Border style.
borderColor
Color
Border color.
SetStyle(Style)
Sets the style of the range.
public void SetStyle(Style style)
Parameters
style
Style
The Style object.
UnMerge()
Unmerges merged cells of this range.
public void UnMerge()
Union(string)
Union another range.
public UnionRange Union(string range)
Parameters
range
string
The range.
Returns
Union(UnionRange)
Union another range.
public UnionRange Union(UnionRange unionRange)
Parameters
unionRange
UnionRange
The range.
Returns
Union(Range[])
Union the ranges.
public UnionRange Union(Range[] ranges)
Parameters
ranges
Range[]
The ranges.