Setting Blazor Grid EnablePersistence=true does not persist column filter

I am using SyncFusion.Blazor v18.2.0.47

I have a grid where I have a FilterTemplate on a column to allow the user to select from a dropdownlist. This all works as expected. However, now I need to persist the selected filter when I navigate away from the page with the list so that the filter is applied once I navigate back to the list.

I have EnablePersistence="true" on the grid. When I apply the filter, navigate away and then navigate back, it does not apply the filter.

I tried applying a sort as well, using the built-in grid sorting, and when I sort, navigate away and then navigate back, the sort persists as expected. Just the filter is not persisting. 

Here is my Grid markup;

        <SfGrid @ref="@Grid" ID="productList" TValue="Product" AllowPaging="true" AllowFiltering="true" AllowSorting="true" EnablePersistence="true">
            <GridEvents OnActionComplete="ActionCompleteHanlder" TValue="Product"></GridEvents>
            <GridPageSettings PageSize="@DefaultPageSize" PageSizes="@PageSizes"></GridPageSettings>
            <SfDataManager Headers="@HeaderData" Url="@CdApiUrl" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>
            <GridSortSettings>
                <GridSortColumns>
                    <GridSortColumn Field="Name" Direction="SortDirection.Ascending"></GridSortColumn>
                </GridSortColumns>
            </GridSortSettings>

            <GridColumns>
                <GridColumn HeaderText="" Width="150px" AllowFiltering="false">
                    <Template>
                        @{
                            var product = (context as Product);
                            <button Class="btn btn-outline-primary"
                                    @onclick="@(_ =>
                                              {
                                                  if (product != null) HandleProductSelectClick(product.Id);
                                              })">
                                <span class="far fa-edit"></span> Manage
                            </button>
                        }
                    </Template>
                </GridColumn>
                <GridColumn Field=@nameof(Product.PartNumber) HeaderText="Part Number" FilterSettings="@Filtering" Width="150"></GridColumn>
                <GridColumn Field=@nameof(Product.Name) HeaderText="Product Name" FilterSettings="@Filtering"></GridColumn>
                <GridColumn Field=@nameof(Product.ProductChannel) HeaderText="Channel" Width="150">
                    <FilterTemplate>
                        <SfDropDownList PlaceHolder="Channel Type" ID="Channel" Value="@((string)(context as PredicateModel).Value)" DataSource="@ChannelTypeValues" TValue="string" TItem="string">
                            <DropDownListEvents ValueChange="@HandleChangeChannelTypeFilter" TValue="string"></DropDownListEvents>
                            <DropDownListFieldSettings Value="string" Text="string"></DropDownListFieldSettings>
                        </SfDropDownList>
                    </FilterTemplate>
                </GridColumn>
                <GridColumn Field=@nameof(Product.Status) HeaderText="Status" Width="150px">
                    <FilterTemplate>
                        <SfDropDownList PlaceHolder="Status Type" ID="Status" Value="@((string)(context as PredicateModel).Value)" DataSource="@StatusTypeValues" TValue="string" TItem="string">
                            <DropDownListEvents ValueChange="@HandleChangeStatusTypeFilter" TValue="string"></DropDownListEvents>
                            <DropDownListFieldSettings Value="string" Text="string"></DropDownListFieldSettings>
                        </SfDropDownList>
                    </FilterTemplate>
                </GridColumn>
            </GridColumns>
        </SfGrid>

And here are my handlers for applying the filters;

        protected void HandleChangeStatusTypeFilter(ChangeEventArgs<string> args)
        {
            if (args.Value == "All")
            {
                Grid.ClearFiltering();
                ShowClearFilterButton = false;
            }
            else
            {
                Grid.FilterByColumn("Status", "equal", args.Value, null, true);
                ShowClearFilterButton = true;
            }
        }

        protected void HandleChangeChannelTypeFilter(ChangeEventArgs<string> args)
        {
            if (args.Value == "All")
            {
                Grid.ClearFiltering();
                ShowClearFilterButton = false;
            }
            else
            {
                Grid.FilterByColumn("ProductChannel", "equal", args.Value, null, true);
                ShowClearFilterButton = true;
            }
        }


What am I missing here?

 

5 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team August 5, 2020 02:14 PM UTC

Hi David, 

Greetings from Syncfusion support. 

We have confirmed it as a bug and logged the defect report “FilterSettings not get persisted after page navigation when EnablePersistence in Grid” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and including the defect fix in our upcoming Bi-weekly release which is expected to be rolled by the mid of September, 2020.   
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Marked as answer

KA Keith A Price September 11, 2021 09:32 PM UTC

any progress on this bug? I'm experiencing the same thing.



RS Renjith Singh Rajendran Syncfusion Team September 13, 2021 01:04 PM UTC

Hi David, 

We have already fixed this issue in our latest release versions. We recommend you to upgrade to our latest version 19.2.0.60 for the latest fixes and features.  

Please find the release notes below, 

If you are still facing any difficulties, then kindly get back to us a detailed explanation of the problem you are facing along with a simple issue reproducing sample for us to proceed further. 

Regards, 
Renjith R 



JC Jacob Clinton April 15, 2024 01:16 PM UTC

This issue seems to have come back. Can one of the SF team look into it?



PS Prathap Senthil Syncfusion Team April 16, 2024 09:44 AM UTC

Hi Jacob,


We are unable to reproduce the reported issue when attempting to do so in the latest version, 25.1.40. For your reference, we have attached a screen recording and a simple sample. Therefore, to proceed further with the reporting of the problem, we require some additional clarification from your end. Please share the details below to proceed further at our end.

  • To analyze the reported issue, could you please share a simple and reproducible sample that demonstrates the problem? This will assist us in identifying the issue more efficiently and providing a resolution.
  • If possible, kindly share your attempt to replicate the issue using the attached simple sample.

Above-requested details will be very helpful in validating the reported query at our end and providing a solution as early as possible. Thanks for your understanding.


Regards,
Prathap S


Loader.
Up arrow icon