officefileapi-devexpress-dot-spreadsheet-dot-cellrange-e4630b6a.md
Gets the number of rows in the cell range.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
int RowCount { get; }
ReadOnly Property RowCount As Integer
| Type | Description |
|---|---|
| Int32 |
An integer that specifies the number of rows.
|
To obtain the number of columns in the cell range, use the CellRange.ColumnCount property.
If the current cell range is a complex (union) range, the RowCount property returns the number of rows in the rectangular cell range that covers all areas of the union range. For example, the RowCount value for the union range B3:C4, D6:E7 shown in the image below is 5.
The following code snippets (auto-collected from DevExpress Examples) contain references to the RowCount property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-spreadsheet-use-custom-cell-editors/CS/DevAVInvoicing/Form1.cs#L118
DefinedName invoiceItems = sheet.DefinedNames.GetDefinedName("InvoiceItems");
btnRemoveRecord.Enabled = invoiceItems != null && invoiceItems.Range.RowCount > 1 && invoiceItems.Range.IsIntersecting(sheet.SelectedCell);
}
how-to-export-cell-range-to-a-datatable/CS/ExportToDataTableExample/Form1.cs#L38
int firstDataRowIndex = rangeHasHeaders ? 1 : 0;
int rowCount = range.RowCount;
if (firstDataRowIndex < rowCount) {
how-to-use-excel-add-ins-in-winforms-spreadsheet/CS/SpreadsheetAddIn/Form1.cs#L164
{
int height = parameter.RowCount;
int width = parameter.ColumnCount;
winforms-spreadsheetcontrol-api-part1/CS/SpreadsheetControl/SpreadsheetActions/CellActions.cs#L205
// Get the number of cells in the range.
int cellCount = sourceRange.RowCount * sourceRange.ColumnCount;
// Get the number of cells in the range.
int cellCount = sourceRange.RowCount * sourceRange.ColumnCount;
winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L109
Dim invoiceItems As DefinedName = sheet.DefinedNames.GetDefinedName("InvoiceItems")
btnRemoveRecord.Enabled = invoiceItems IsNot Nothing AndAlso invoiceItems.Range.RowCount > 1 AndAlso invoiceItems.Range.IsIntersecting(sheet.SelectedCell)
Else
how-to-export-cell-range-to-a-datatable/VB/ExportToDataTableExample/Form1.vb#L37
Dim firstDataRowIndex As Integer = If(rangeHasHeaders, 1, 0)
Dim rowCount As Integer = range.RowCount
If firstDataRowIndex < rowCount Then
how-to-use-excel-add-ins-in-winforms-spreadsheet/VB/SpreadsheetAddIn/Form1.vb#L177
Private Function ConvertRefParameter(ByVal parameter As DevExpress.Spreadsheet.CellRange) As Object(,)
Dim height As Integer = parameter.RowCount
Dim width As Integer = parameter.ColumnCount
winforms-spreadsheetcontrol-api-part1/VB/SpreadsheetControl/SpreadsheetActions/CellActions.vb#L191
' Get the number of cells in the range.
Dim cellCount As Integer = sourceRange.RowCount * sourceRange.ColumnCount
' Get the number of cells in the range.
Dim cellCount As Integer = sourceRange.RowCount * sourceRange.ColumnCount
See Also