The DataGrid can persist its state. If a user sorts and filters data, groups, reorders and resizes columns, or makes other changes, the component saves these modifications and restores them when a user reloads the page. Refer to the stateStoring article for a full list of modifications that can be saved.
To enable state persistence, set stateStoring.enabled to true and specify the storageKey and type properties. Depending on the type, the state can be saved to a localStorage or sessionStorage. With localStorage, the state persists across browser sessions; with sessionStorage, it is reset after the current session. This demo uses localStorage.