DataGrid - ShowFilterBarStatus not working when EnablePersistence is true
Maybe it is a regression, see historic issue: https://www.syncfusion.com/forums/158639/grid-showfilterbarstatus-false-does-not-appear-to-work
I see the same behavior: the status bar in the pager shows the filters, even though I explicitly set ShowFilterBarStatus="false" on the GridFilterSettings. Apparently this is an issue when EnablePersistence="true" is set on the SfGrid.
Hi Peter,
Greetings from Syncfusion support.
Based on your query, it appears that when ShowFilterbarStatus is set to false,
the filter bar values are still visible in the grid pager. We have created a
sample based on your requirements, including the EnablePersistence property.
However, we were unable to reproduce the reported issue on our end. Please
refer to the attached code snippet and sample for your reference.
|
<SfGrid @ref="DefaultGrid" EnablePersistence="true" AllowFiltering="true" ID="Grid123" DataSource="@Orders" AllowSorting="true" AllowPaging="true"> <GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.FilterBar" ShowFilterBarStatus="false"></GridFilterSettings> <GridColumns> . . . </GridColumns> </SfGrid> |
Sample: https://blazorplayground.syncfusion.com/embed/hjLzDVCBTGQdWiVO?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5
If still issue persists, kindly share the following details to us.
- Mentioned issue occurs in which version?
- Share the video demo of an issue.
- Share the grid code snippet and issue reproducible sample to us.
- If possible, reproduce a reported issue in the provided sample.
Above requested details help us to further validate your
query and provide precise solution ASAP from our end.
Regards,
Sarvesh
Hi Sarvesh,
thank you for your support, this helped me identify the root cause. Here is what I found to reproduce the issue:
- First, enable filter bar status: ShowFilterBarStatus="true"
- Run app and enter any search value into a search field
- Close app and disable filter bar status: ShowFilterBarStatus="false"
- Run app and see that the filter is always displayed in the status bar
Hi Peter,
We want to inform you that when using the enablePersistence property, the grid
maintains local browser storage. Consequently, if you re-render the grid with
ShowfilterBarStatus set to false, it will retrieve the values from local
storage again. If you need to clear the local storage, we recommend using our
built-in method ResetPersistDataAsync. This method clears the local storage and
refreshes the grid. For your convenience, we have attached a sample and code
snippet for reference.
|
<SfButton OnClick="FilterStatus">Filter Status</SfButton>
<SfGrid @ref="DefaultGrid" EnablePersistence="true" AllowFiltering="true" ID="Grid123" DataSource="@Orders" AllowSorting="true" AllowPaging="true"> <GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.FilterBar" ShowFilterBarStatus="@filterstatus"></GridFilterSettings> <GridColumns> . . . </GridColumns> </SfGrid> private SfGrid<OrderData> DefaultGrid;
public bool filterstatus = false;
public void FilterStatus() { filterstatus = !filterstatus; if (!filterstatus) { DefaultGrid.ResetPersistDataAsync(); } } } |
Reference: https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_ResetPersistDataAsync
Sample: https://blazorplayground.syncfusion.com/embed/BDrzZrMyqcHtWDiS?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5
If you have any further queries, please get back to us.
Regards,
Sarvesh
- 3 Replies
- 2 Participants
-
PE Peter
- Feb 10, 2024 10:12 AM UTC
- Feb 15, 2024 11:22 AM UTC