[PR #882] [CLOSED] Reset DataGrid in Settings.set #2374

Open
opened 2026-01-29 18:18:33 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/882
Author: @cvanstone
Created: 3/29/2023
Status: Closed

Base: masterHead: datagrid_settings_reset


📝 Commits (3)

  • 9f441bb Reset DataGrid in Settings setter to ensure updated value is not applied in addition to current
  • f7c1a4c Correct Reload path
  • f005e2c Only reload Settings on first render

📊 Changes

2 files changed (+23 additions, -24 deletions)

View changed files

📝 Radzen.Blazor/RadzenDataGrid.razor.cs (+14 -15)
📝 RadzenBlazorDemos/Pages/DataGridSaveSettingsLoadData.razor (+9 -9)

📄 Description

Currently the DataGrid Settings are only reset if the Settings property is called with null. If an application is developed with multiple DataGridSettings that can be saved and loaded, any secondary set is loaded in addition to the first for column sorting.

This branch resets the DataGrid each time the Settings setter is called prior to the updated value being applied and Reload being called meaning the new Settings will be applied from fresh.

As highlighted by enchev in my first pull request, this caused a loop issue in the LoadData Demo. The DataGridSettings were being deserialized and loaded on every OnAfterRenderAsync once Data has been loaded. This only needs to happen on firstRender to avoid continual loop.

I also noted that the Reload button was targeting the IQueryable page.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/radzenhq/radzen-blazor/pull/882 **Author:** [@cvanstone](https://github.com/cvanstone) **Created:** 3/29/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `datagrid_settings_reset` --- ### 📝 Commits (3) - [`9f441bb`](https://github.com/radzenhq/radzen-blazor/commit/9f441bb34d7827fb9e41c9308554c2fe4889b73b) Reset DataGrid in Settings setter to ensure updated value is not applied in addition to current - [`f7c1a4c`](https://github.com/radzenhq/radzen-blazor/commit/f7c1a4c89ffa319c6eba6f6c138b8de8c2f3ef7e) Correct Reload path - [`f005e2c`](https://github.com/radzenhq/radzen-blazor/commit/f005e2cfcfa3499bca7fbda1dc6d6bd30333ab1a) Only reload Settings on first render ### 📊 Changes **2 files changed** (+23 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `Radzen.Blazor/RadzenDataGrid.razor.cs` (+14 -15) 📝 `RadzenBlazorDemos/Pages/DataGridSaveSettingsLoadData.razor` (+9 -9) </details> ### 📄 Description Currently the DataGrid Settings are only reset if the Settings property is called with null. If an application is developed with multiple DataGridSettings that can be saved and loaded, any secondary set is loaded in addition to the first for column sorting. This branch resets the DataGrid each time the Settings setter is called prior to the updated value being applied and Reload being called meaning the new Settings will be applied from fresh. As highlighted by **enchev** in my first pull request, this caused a loop issue in the [LoadData Demo](https://blazor.radzen.com/datagrid-save-settings-loaddata). The `DataGridSettings` were being deserialized and loaded on every `OnAfterRenderAsync` once Data has been `loaded`. This only needs to happen on `firstRender` to avoid continual loop. I also noted that the Reload button was targeting the IQueryable page. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 18:18:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#2374