New to Telerik UI for Blazor? Download Free 30-day trial
Grid - Persist State
- EXAMPLE
- VIEW SOURCE
- Change Theme
default
Configurator
Control the Grid state
Change the grid (for example, filter, page, resize columns, change grouping) and
Save the grid state, then Reload the page to see the state persisted.
Change the grid some more and Load the state to see the last one preserved.
You can manage the grid state with your own code to put it in a specific configuration through the Configure button.
You can also Reset the grid to its default settings. This demo will remember your last grid layout
until your clear your browser storage or click the Reset button.
Drag a column header and drop it here to group by that column
ID | Product Name | Price | In stock | Quantity per unit | Discontinued |
---|---|---|---|---|---|
|
|
|
|
|
(All)
|
1 | Chai | 18 | 39 | 10 boxes x 20 bags | False |
2 | Chang | 19 | 17 | 24 - 12 oz bottles | False |
3 | Aniseed Syrup | 10 | 13 | 12 - 550 ml bottles | False |
4 | Chef Anton's Cajun Seasoning | 22 | 53 | 48 - 6 oz jars | False |
5 | Chef Anton's Gumbo Mix | 21.35 | 0 | 36 boxes | True |
6 | Grandma's Boysenberry Spread | 25 | 120 | 12 - 8 oz jars | False |
7 | Uncle Bob's Organic Dried Pears | 30 | 15 | 12 - 1 lb pkgs. | False |
8 | Northwoods Cranberry Sauce | 40 | 6 | 12 - 12 oz jars | False |
9 | Mishi Kobe Niku | 97 | 29 | 18 - 500 g pkgs. | True |
10 | Ikura | 31 | 31 | 12 - 200 ml jars | False |
11 | Queso Cabrales | 21 | 22 | 1 kg pkg. | False |
12 | Queso Manchego La Pastora | 38 | 86 | 10 - 500 g pkgs. | False |
13 | Konbu | 6 | 24 | 2 kg box | False |
14 | Tofu | 23.25 | 35 | 40 - 100 g pkgs. | False |
15 | Genen Shouyu | 15.5 | 39 | 24 - 250 ml bottles | False |
16 | Pavlova | 17.45 | 29 | 32 - 500 g boxes | False |
17 | Alice Mutton | 39 | 0 | 20 - 1 kg tins | True |
18 | Carnarvon Tigers | 62.5 | 42 | 16 kg pkg. | False |
19 | Teatime Chocolate Biscuits | 9.2 | 25 | 10 boxes x 12 pieces | False |
20 | Sir Rodney's Marmalade | 81 | 40 | 30 gift boxes | False |
- Persist-state.razor
- ProductService.cs
- LocalStorage.cs
- ProductDto.cs
Loading the demo source code...please wait.
Description
You can save and load the grid layout so your users can continue where they left off - paging, grouping, selected items, edited item, column size and order, sorting and filtering - all grid aspects are available. You can also control them programmatically by setting the desired state to the grid in your own code.
This Blazor Data Grid Persist State example is part of a unique collection of hundreds of Blazor demos, with which you can see all Telerik UI for Blazor components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Telerik REPL for Blazor or ThemeBuilder.