officefileapi-devexpress-dot-docs-dot-presentation-dot-table-dot-getactivecells-x28-devexpress-dot-docs-dot-presentation-dot-tabletraversalorder-x29.md
Returns all active cells in the table, skipping merged cells that do not display data.
Namespace : DevExpress.Docs.Presentation
Assembly : DevExpress.Docs.Presentation.v25.2.dll
NuGet Package : DevExpress.Docs.Presentation
public IEnumerable<TableCell> GetActiveCells(
TableTraversalOrder order
)
Public Function GetActiveCells(
order As TableTraversalOrder
) As IEnumerable(Of TableCell)
| Name | Type | Description |
|---|---|---|
| order | TableTraversalOrder |
The order in which to traverse the table cells.
|
| Type | Description |
|---|---|
| IEnumerable<TableCell> |
A collection of table cells.
|
If you merge two cells, both of those cells remain in the internal table structure. One becomes the resulting cell (takes the space of two and displays data). Another disappears from the table (the object remains in case you split the merged cell back into two).
To obtain all cells that display data, call Table.GetActiveCells. This method skips cells that only exist in the internal structure and do not display data. If you traverse cells manually, you can identify these inactive cells by checking if IsMergedVertically or IsMergedHorizontally is true.
The following code snippet iterates through all active cells in a table and obtains a list of 8 cells:
using DevExpress.Docs.Presentation;
IEnumerable<TableCell> tableCells = table.GetActiveCells(TableTraversalOrder.RowThenColumn);
Imports DevExpress.Docs.Presentation
Dim tableCells As IEnumerable(Of TableCell) = table.GetActiveCells(TableTraversalOrder.RowThenColumn)
See Also