Back to Devexpress

BaseView.RowCountChanged Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-baseview-ba77d119.md

latest3.3 KB
Original Source

BaseView.RowCountChanged Event

Occurs when the number of visible records is changed within a View.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Property Changed")]
public event EventHandler RowCountChanged
vb
<DXCategory("Property Changed")>
Public Event RowCountChanged As EventHandler

Event Data

The RowCountChanged event's data class is EventArgs.

Remarks

This event occurs in multiple instances when the number of visible records is changed:

  • when a row is added or deleted;
  • when a filter is applied so that only specific records are visible;
  • when data is grouped or ungrouped by a column so that the number of top level group rows is changed;
  • when a group row is expanded or collapsed.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RowCountChanged event.

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-grid-change-height-to-match-height-of-rows/CS/GridControlAutoSize/Form1.cs#L52

csharp
private void MainForm_Shown(object sender, EventArgs e) {
    gridView1.RowCountChanged += new EventHandler(OnGridViewRowCountChanged);
    gridView1.ColumnWidthChanged += new ColumnEventHandler(OnGridViewColumnWidthChanged);

winforms-grid-change-height-to-match-height-of-rows/VB/GridControlAutoSize/Form1.vb#L54

vb
Private Sub MainForm_Shown(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Shown
    AddHandler gridView1.RowCountChanged, AddressOf OnGridViewRowCountChanged
    AddHandler gridView1.ColumnWidthChanged, AddressOf OnGridViewColumnWidthChanged

See Also

DataRowCount

RowCount

BaseView Class

BaseView Members

DevExpress.XtraGrid.Views.Base Namespace