Cell.IsTopLeftCellInArrayFormulaRange Property
Indicates whether the current cell is the top left cell in the array formula range.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v24.1.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Property Value
Type | Description |
---|---|
Boolean | true, if the current cell is the top left cell in the array formula range; otherwise, false. |
Remarks
Use the IsTopLeftCellInArrayFormulaRange property if you need to obtain the array formula for a cell. You should get the range of cells using the Cell.GetArrayFormulaRange method and loop through each cell, checking the IsTopLeftCellInArrayFormulaRange property to find the top left cell. The value of the CellRange.ArrayFormula property of this cell will give you the array formula string.
Here is a brief explanation of this technique.
Cells which belong to an array formula range behave differently from other cells. If a cell belongs to the array formula range, its value and formula are protected, so an attempt to modify cell data throws an exception. For all cells in the range except the top left cell, the CellRange.ArrayFormula and CellRange.Formula properties return an empty string, so use the Cell.GetArrayFormulaRange method to obtain the entire range and use its ArrayFormula property to obtain or modify the array formula.
The top left cell in the array formula range differs from other cells in that range. Its ArrayFormula property returns the array formula.