Skip to content

Commit 0661226

Browse files
chore(grid): likn state evetns from events article
1 parent 97ecb34 commit 0661226

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

components/grid/events.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This article explains the events available in the Telerik Grid for Blazor. They
1515
* [CUD Events](#cud-events) - events related to Creating, Updating and Deleting items
1616
* [Read Event](#read-event) - event related to obtaining data
1717
* [Other Events](#other-events) - other events the grid provides
18+
* [State Events](#state-events)
1819
* [Command Button Click](#command-button-click)
1920
* [SelectedItemsChanged](#selecteditemschanged)
2021
* [OnRowClick](#onrowclick)
@@ -36,6 +37,16 @@ In the common case, you provide all the data to the grid's `Data` collection and
3637

3738
## Other Events
3839

40+
### State Events
41+
42+
The grid state lets you control through code the aspects of the grid the user can control in the UI - such as filtering, sorting, grouping. The grid provides two events related to the state:
43+
44+
* `OnStateInit` - fires when the grid initializes so you can provide a stored version of the grid.
45+
46+
* `OnStateChanged` - fires when the user performs an action so you can see what area was changed and, if needed, alter the grid state.
47+
48+
Review the [grid state]({%slug grid-state%}) article for more details and examples on how the grid state works and what you can do with it.
49+
3950
### Command Button Click
4051

4152
The command buttons of a grid provide an `OnClick` event before firing their built-in command (such as opening a row for editing, or adding a new row). You can do this to implement some additional logic and to also handle custom commands - both from a [Command Column]({%slug components/grid/columns/command%}), and from a [Toolbar Button]({%slug components/grid/features/toolbar%})

components/grid/state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ If you want the grid to start with certain settings for your end users, you can
362362

363363
Sometimes you may want to know what the user changed in the grid (e.g., when they filter, sort and so on) and even override those operations. One way to do that is to monitor the [`OnRead`]({%slug components/grid/manual-operations%}#cache-data-request) event, cache the previous `DataSourceRequest`, compare against it, alter it if needed, and implement the operations yourself. Another is to use the `OnStateChanged` event.
364364

365-
The example below shows the latter. Review the code comments to see how it works and to make sure you don't get issues.
365+
The example below shows the latter. Review the code comments to see how it works and to make sure you don't get issues. You can find another example of overriding the user actions in the [Static Grid Group]({%slug grid-kb-static-group%}) Knowledge Base article.
366366

367367
>caption Know when the grid state changes, which parameter changes, and amend the change
368368

0 commit comments

Comments
 (0)