Hi Seckin,
Greetings from Syncfusion support.
In this
forum, we have provided solution to change the pagesize in OnAfterRender lifecycle method of Grid. Hence the reported behavior occurred when enabling the persistence in Grid. We suggest you to achieve your requirement by handling page size on the
Databound event. So that the grid will rendered with new page size for each time when we refresh the browser.
Kindly check the attached code snippet and sample for your reference.
|
<SfGrid ID="page4" @ref="Grid" DataSource="@Orders" EnablePersistence="true" AllowPaging="true">
<GridEvents DataBound= "Databound" TValue="Order"></GridEvents>
<GridColumns>
...
</GridColumns>
</SfGrid>
@code{
public bool FirstRender = true;
public async Task Databound()
{
if (FirstRender)
{
var dimension = await Service.GetDimensions();
var visina = dimension.Height - 170;
(this.Grid.PageSettings as GridPageSettings).PageSize = visina / 37;
FirstRender = false;
Grid.Refresh();
}
} |
Kindly get back to us if we misunderstood your query or if you have further queries.
Regards,
Monisha