aspnet-devexpress-dot-web-dot-aspxgridview-bcb23e87.md
Gets the number of visible rows within the ASPxGridView.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public int VisibleRowCount { get; }
Public ReadOnly Property VisibleRowCount As Integer
| Type | Description |
|---|---|
| Int32 |
The number of visible rows within the ASPxGridView.
|
The VisibleRowCount property returns the number of visible rows that the grid displays within all its pages. These include both data rows and group rows (if data is grouped). Rows contained within collapsed group rows are not counted. If data is filtered, the VisibleRowCount property returns the number of filtered rows.
A user can see the number of visible rows within the Pager:
To learn more, see Traversing Rows.
The following code snippets (auto-collected from DevExpress Examples) contain references to the VisibleRowCount 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.
ASPxGridView grid = ASPxGridLookup1.GridView;
for(int i = grid.VisibleStartIndex; i < grid.VisibleRowCount; i++) {
int unitPrice = Convert.ToInt32(grid.GetRowValues(i, new string[] { "UnitPrice" }));
asp-net-web-forms-grid-cache-data-on-the-client-side/CS/Solution/Default.aspx.cs#L9
int startIndex = grid.PageIndex * grid.SettingsPager.PageSize;
int end = Math.Min(grid.VisibleRowCount, startIndex + grid.SettingsPager.PageSize);
object[] titleId = new object[end - startIndex], titles = new object[end - startIndex];
Dim grid As ASPxGridView = ASPxGridLookup1.GridView
For i As Integer = grid.VisibleStartIndex To grid.VisibleRowCount - 1
Dim unitPrice As Integer = Convert.ToInt32(grid.GetRowValues(i, New String() {"UnitPrice"}))
asp-net-web-forms-grid-move-selected-rows-between-grid-controls/VB/E2636/Default.aspx.vb#L49
Case "addAllRows"
For i As Integer = 0 To SourceGrid.VisibleRowCount - 1
rowValues.Add(SourceGrid.GetRowValues(i, fieldNames))
asp-net-web-forms-grid-cache-data-on-the-client-side/VB/Solution/Default.aspx.vb#L14
Dim startIndex As Integer = grid.PageIndex * grid.SettingsPager.PageSize
Dim [end] As Integer = Math.Min(grid.VisibleRowCount, startIndex + grid.SettingsPager.PageSize)
Dim titleId As Object() = New Object([end] - startIndex - 1) {}, titles As Object() = New Object([end] - startIndex - 1) {}
See Also