Represents a reference to a cell in A1 notation e.g. "A1", "B2", etc. The row and column are zero-based indices, so "A1" corresponds to (0, 0) and "B2" corresponds to (1, 1). This struct is immutable and provides methods for parsing, comparing, and converting to string representation.
Namespace: Radzen.Documents.Spreadsheet
Assembly: Radzen.Blazor.dll
public struct CellRefRepresents a reference to a cell in A1 notation e.g. "A1", "B2", etc. The row and column are zero-based indices, so "A1" corresponds to (0, 0) and "B2" corresponds to (1, 1). This struct is immutable and provides methods for parsing, comparing, and converting to string representation.
public CellRef(int row, int column)
| Type | Name | Description |
|---|---|---|
| int | row | |
| int | column |
Gets the column index of the cell reference. The column index is zero-based, so the first column (A1) corresponds to 0.
public int Column { get; }
| Type | Description |
|---|---|
| int | Gets the column index of the cell reference. The column index is zero-based, so the first column (A1) corresponds to 0. |
Represents an invalid cell reference with row and column set to -1.
public Documents.Spreadsheet.CellRef Invalid { get; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.CellRef | Represents an invalid cell reference with row and column set to -1. |
Indicates whether the column reference is absolute (prefixed with '$' in A1 notation).
public bool IsColumnAbsolute { get; set; }
| Type | Description |
|---|---|
| bool | Indicates whether the column reference is absolute (prefixed with '$' in A1 notation). |
Indicates whether the row reference is absolute (prefixed with '$' in A1 notation).
public bool IsRowAbsolute { get; set; }
| Type | Description |
|---|---|
| bool | Indicates whether the row reference is absolute (prefixed with '$' in A1 notation). |
Gets the row index of the cell reference. The row index is zero-based, so the first row (A1) corresponds to 0.
public int Row { get; }
| Type | Description |
|---|---|
| int | Gets the row index of the cell reference. The row index is zero-based, so the first row (A1) corresponds to 0. |
Gets the optional sheet name qualifier for this reference. When null, the reference targets the current sheet.
public string Worksheet { get; set; }
| Type | Description |
|---|---|
| string | Gets the optional sheet name qualifier for this reference. When null, the reference targets the current sheet. |
public bool Equals(Documents.Spreadsheet.CellRef other)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.CellRef | other |
| Type | Description |
|---|---|
| bool |
public override bool Equals(object obj)
| Type | Name | Description |
|---|---|---|
| object | obj |
| Type | Description |
|---|---|
| bool |
Parses a string in A1 notation (e.g., "A1", "B2") into a CellRef instance. If the string is not a valid A1 notation, it throws an ArgumentException.
public static Documents.Spreadsheet.CellRef Parse(string index)
| Type | Name | Description |
|---|---|---|
| string | index | The A1 notation string to parse. |
| Type | Description |
|---|---|
| Documents.Spreadsheet.CellRef | A CellRef instance representing the parsed cell reference. |
Swaps two CellRef instances if the first one is greater than the second one. This is useful for ensuring a consistent order when comparing or storing cell references.
public static ValueTuple<Documents.Spreadsheet.CellRef, Documents.Spreadsheet.CellRef> Swap(Documents.Spreadsheet.CellRef a, Documents.Spreadsheet.CellRef b)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.CellRef | a | |
| Documents.Spreadsheet.CellRef | b |
| Type | Description |
|---|---|
| ValueTuple<Documents.Spreadsheet.CellRef, Documents.Spreadsheet.CellRef> |
Converts the cell reference to a range reference that includes the cell itself.
public Documents.Spreadsheet.RangeRef ToRange()
| Type | Description |
|---|---|
| Documents.Spreadsheet.RangeRef |
Returns a string representation of the cell reference in A1 notation. For example, if the cell reference is (0, 0), it returns "A1"; if the cell reference is (1, 1), it returns "B2".
public override string ToString()
| Type | Description |
|---|---|
| string |
Attempts to parse a string in A1 notation (optionally with '$' absolute markers) into a CellRef instance. Returns true if successful and outputs absolute flags for the column and row.
public static bool TryParse(string index, Documents.Spreadsheet.CellRef& result)
| Type | Name | Description |
|---|---|---|
| string | index | |
| Documents.Spreadsheet.CellRef& | result |
| Type | Description |
|---|---|
| bool |
public static bool operator !=(Documents.Spreadsheet.CellRef left, Documents.Spreadsheet.CellRef right)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.CellRef | left | |
| Documents.Spreadsheet.CellRef | right |
| Type | Description |
|---|---|
| bool |
public static bool operator ==(Documents.Spreadsheet.CellRef left, Documents.Spreadsheet.CellRef right)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.CellRef | left | |
| Documents.Spreadsheet.CellRef | right |
| Type | Description |
|---|---|
| bool |