Fix grid rendering issues, page size reset bug, and improve Sidebar/Sidebar2 behavior on mobile #1203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses several issues related to Grid behavior, filter rendering, and UI interactions across the application. It includes bug fixes, rendering improvements, and enhancements to the user experience.
Fixes & Improvements
1. PageSize Selector Bug
Issue: Changing the page size from the selector at the bottom of the table (
) caused the value to reset to 10.
Fix: Introduced a new variable (
pendingPageSizeChanging) to prevent the grid from resetting the page during component rendering.Additional: Updated and corrected the logic inside
OnPageSizeChangedAsync.2. Grid Settings Not Reflected in HTML After Load
Issue:
LoadGridSettingsAsync()correctly restored saved settings, but the UI did not reflect these restored values.Cause: Blazor prerendering caused the initial UI state to display before filters were fully loaded.
Fix: Introduced an
isColumnsLoadingflag to show placeholders during prerendering and display the correct filter state once loading completes.3. Checkbox Rendering Issues in Filters
Issue: Checkbox filters were not applying the “checked” state correctly even when set to true.
Fix: Added a new
RenderFragment InputFilterTemplate()inGridColumnFilter.razor.csto handle checkbox rendering cleanly.4. Missing async / Incorrect Task Handling
Added missing
asynckeywords in several methods withinGrid.razor.cs.Replaced return
Task.CompletedTaskwith properawaitusage to ensure asynchronous flow behaves as expected.5. Mobile Navigation Menu Fix
Issue: In mobile view (sidebar and sidebar2), clicking on a menu item did not close the NavMenu.
Fix: Implemented automatic closing of the navigation menu after a user selects an item.