Cells are constituent elements of a worksheet. An individual cell is represented by the object that implements the Cell interface. This interface is inherited from the Range interface, which provides basic functionality to work with worksheet cells, cell ranges, rows and columns.
Worksheet data is stored in cells. Each cell holds a single piece of data - the cell value. To access a cell value, use the Range.Value property. The Cell.DisplayText property returns a string that specifies a formatted value as it is displayed in a cell.
A cell can also contain a formula that calculates the cell value dynamically. To specify a cell formula, use the Range.Formula property. In formulas, you can refer to cells and cell ranges using cell references of different types.
When working with worksheet data, you can access and modify individual cells, as well as cell range, entire rows and columns. For more information, see the Cells and Cell Ranges document that provides an overview of the functionality available to manage worksheet cells, and the Cells section that provides examples.
This example demonstrates several ways to access individual cells.
By a column index or column heading from the specified row. Use the Row.Item property.
By a row index or row heading from the specified column. Use the Column.Item property.
See the How to: Access a Row or Column example to learn how to get an individual row or column.
using DevExpress.Spreadsheet; // ... IWorkbook workbook = spreadsheetControl1.Document; Worksheet worksheet = workbook.Worksheets; Cell cellA1 = worksheet[0, 0]; // Cell A1 Cell cellB2 = worksheet.Cells["B2"]; // Cell B2 Cell cellC2 = worksheet.Cells[1, 2]; // Cell C2 Cell cellD3 = worksheet.Cells[2, 3]; // Cell D3 Cell cellE4 = worksheet.Rows["E"]; // Cell E4 Cell cellF4 = worksheet.Rows["4"]; // Cell F4 Cell cellG5 = worksheet.Columns; // Cell G5 Cell cellH6 = worksheet.Columns["H"]; // Cell H6 Cell cellI7 = worksheet.Columns["I"]["7"]; // Cell I7 // Access a cell from the range of cells. Cell cellB5 = worksheet.Range["B3:D6"]; // Cell B5 Cell cellD6 = worksheet.Range["B3:D6"][3, 2]; // Cell D6