State Management in Blazor DataGrid component

Hello

Is it possible to maintain the state of the grid, when web page is refreshed so that it maintains the page number and also the text that was written in the search box?

My sfgrid is declared as follows:

<SfGrid DataSource="@dsProyectos" AllowPaging="true" AllowSorting="true" Toolbar=@toolBar RowHeight="30"
        AllowSelection="true" AllowFiltering="false" EnablePersistence="true">
    <GridEditSettings AllowEditing="false"></GridEditSettings>
    <GridPageSettings PageSize="20"></GridPageSettings>
    <GridSelectionSettings PersistSelection="true"></GridSelectionSettings> 
    <GridColumns>
        
            <GridColumn Field=@nameof(ProjectModel.PROJECT_ID) TextAlign="TextAlign.Left" Width="150" IsPrimaryKey="true"
                    CustomAttributes="@(new Dictionary<string, object>() {{"class", "e-attr"}})">
            <HeaderTemplate>
                <div>ID</div>
            </HeaderTemplate>
        </GridColumn>
      .....
    </GridColumns>
</SfGrid>

3 Replies

JL jose luis barajas December 7, 2020 10:10 PM UTC

I forgot to add the following

<SfGrid ID="Grid" DataSource="@dsProyectos"


but sometimes pagination works and save the search text and sometimes not, it is inconsistent


VN Vignesh Natarajan Syncfusion Team December 8, 2020 06:55 AM UTC

Hi Jose,   
 
Thanks for contacting Syncfusion support.  
 
Query: “ but sometimes pagination works and save the search text and sometimes not, it is inconsistent 
 
We have analyzed your query and we are able to reproduce the reported issue at our end also. We have confirmed it is a bug and logged the defect report “Pager is not persisted when GridPageSettings is defined explicitly 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 weekly release which is expected to be rolled out by mid of January, 2021. We will update you once the release is rolled out.   
      
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.      
  
 
Till then we appreciate your patience.   
 
Regards, 
Vignesh Natarajan  
 
 
 
 
 
 
 
 



VN Vignesh Natarajan Syncfusion Team January 12, 2021 01:14 PM UTC

Hi Jose 

We are glad to announce that our weekly patch release (v18.4.0.34) has been rolled out successfully and in this release we have included the fix for Pager is not persisted when GridPageSettings is defined explicitly in Grid Pager is not persisted when GridPageSettings is defined explicitly in Grid” issue. So kindly update your NuGet (Syncfusion.Blazor) to our latest version (18.4.0.34) to resolve the issue reported. 

Please find the Nuget package from below 



 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.  

Regards, 
Vignesh Natarajan  
 


Loader.
Up arrow icon