Setting PageSize in 19.4.0.52 no longer working

Using code provided elsewhere, we are setting Grid.PageSize in OnAfterRenderAsync(bool firstRender) event by determining page viewport size so that Grids auto-size and auto-page to viewable area.

Our code was working fine in SyncFusion.Blazor 19.4.0.50 - all OK.

After updating to today's 19.4.0.52, changing PageSize in this event no longer works. Grid loads with initial default page size, then after value change, paging is corrupted (i.e. cannot even move to 2nd page, and initial page is NOT resized). I have confirmed that the grid is NOT re-requesting the correct Top N data, so it seems it is failing internally somewhere.

We have rolled back to 19.4.0.50, and same code is again working.


6 Replies

RN Rahul Narayanasamy Syncfusion Team February 17, 2022 03:35 PM UTC

Hi Phil, 

Greetings from Syncfusion. 

Based on your shared details we have checked the reported problem. Here, we have set the Grid PageSize in OnAfterRenderAsync lifecycle and ensured the reported problem. The Grid is rendered with calculated PageSize and we can able to move to the next page without any issues. Find the below code snippets and sample for your reference. 
 
 
<SfGrid ID="page6" @ref="Grid" DataSource="@Orders" AllowPaging="true"> 
    <GridEvents DataBound= "Databound" TValue="Order"></GridEvents> 
    <GridPageSettings PageSize="@PageSize"></GridPageSettings> 
    <GridColumns> 
        . . . 
    </GridColumns> 
</SfGrid> 
 
@code{ 
    SfGrid<Order> Grid; 
    public List<Order> Orders { get; set; } 
    public bool FirstRender = true; 
    int PageSize { get; set; } = 8; 
 
    protected override async Task OnAfterRenderAsync(bool firstRender) 
    { 
        if (firstRender) 
       { 
            var dimension = await Service.GetDimensions(); 
            var visina = dimension.Height - 170; 
            PageSize = visina / 37; 
            FirstRender = false; 
            Grid.Refresh(); 
        } 
    } 
 
    .. .  
 
} 


Also, we need some details regarding your reported problem. Could you please share the below details which will be helpful to validate and provide a better solution. 

  • Full Grid code snippets.
  • Share details about how you are setting PageSize based on the page view port.
  • Reproduce the reported problem in the provided sample and revert back to us / share a simple reproduceable sample if possible.
  • Video demonstration the problem.

Regards, 
Rahul 




SG Stanislav Gordenko February 17, 2022 09:59 PM UTC

Hi, it is not the problem of page size. I think that there is a trouble with data adaptor connection in last update. I have the trouble with showing of almost all grids, with filter selection and so on. Only the first rendering sometimes goes well, and after the first update the grid is broken!



SG Stanislav Gordenko February 17, 2022 10:16 PM UTC

It is often not any data adapter request.



RN Rahul Narayanasamy Syncfusion Team February 18, 2022 10:46 AM UTC

Hi Stanislav, 

Thanks for the update. 

We need some details regarding the reported problem to check this further. Could you please share the below details which will be helpful to validate and provide a better solution. 

  • Full Grid code snippets.
  • Did you used CustomAdaptor/ any other adaptors with any Grid events?
  • Video demonstration of the problem.
  • Share a simple reproduceable sample if possible.

Regards, 
Rahul 



PH Phil Holmes March 3, 2022 08:07 AM UTC

Hi,

For what its worth, today I have updated from 19.4.0.50 (working), to latest 19.4.0.54 and the unchanged pagesize code is WORKING.

i.e. it was NOT WORKING in 19.4.0.52, so I reverted to 19.4.0.50 (working), and whatever was wrong in 19.4.0.52 seems to have been rectified in 0.54.

In my testing of each of these, there were not changes to my pagesize setting code. Only change was nuget versions.

So assuming no further occurrance, from my perspective, this can be closed. I can't comment for Stanislav.

Regards,
Phil



RN Rahul Narayanasamy Syncfusion Team March 4, 2022 07:52 AM UTC

Hi Phil, 

Thanks for the update. 

You have resolved the reported problem after upgrading to the latest version(19.4.0.54). Please get back to us if need any other queries or assistance. 

Regards, 
Rahul 


Loader.
Up arrow icon