Back to Devexpress

ASPxGridView.VisibleRowCount Property

aspnet-devexpress-dot-web-dot-aspxgridview-bcb23e87.md

latest4.8 KB
Original Source

ASPxGridView.VisibleRowCount Property

Gets the number of visible rows within the ASPxGridView.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public int VisibleRowCount { get; }
vb
Public ReadOnly Property VisibleRowCount As Integer

Property Value

TypeDescription
Int32

The number of visible rows within the ASPxGridView.

|

Remarks

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.

asp-net-web-forms-grid-lookup-access-selected-data/CS/ASPxGridLookUpSelection/ServerSide_SingleSelect.aspx.cs#L24

csharp
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

csharp
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];

asp-net-web-forms-grid-lookup-access-selected-data/VB/ASPxGridLookUpSelection/ServerSide_SingleSelect.aspx.vb#L25

vb
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

vb
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

vb
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

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace