# DataGridViewChangeEvent (@salmonui/data-grid)

> The DataGridViewChangeEvent interface of @salmonui/data-grid: onViewChange (type: 'viewChange'): fires once per committed change of the displayed rows (data, sort, filter, search, group, page), after the commit that rendered it. Never on scroll, focus, selection, or group / detail expansion. Not cancellable.

Canonical: https://salmonui.dev/docs/reference/data-grid/DataGridViewChangeEvent

```ts
import type { DataGridViewChangeEvent } from '@salmonui/data-grid';
```

Entry index: https://salmonui.dev/docs/reference/data-grid (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid.md).

## Reference

Kind: interface

```ts
interface DataGridViewChangeEvent extends DataGridEvent {
    readonly rowCount: number;
    readonly totalRowCount: number;
    readonly reason: DataGridViewChangeReason;
}
```

`onViewChange` (`type: 'viewChange'`): fires once
per committed change of the displayed rows (data, sort, filter, search,
group, page), after the commit that rendered it. Never on scroll, focus,
selection, or group / detail expansion. Not cancellable.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowCount` | `readonly rowCount: number;` |  | Data rows in the view (the current page; captions and footers not counted). |
| `totalRowCount` | `readonly totalRowCount: number;` |  | Rows matching the query across every page. |
| `reason` | `readonly reason: DataGridViewChangeReason;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |
