Hi Kins,
Greetings from Syncfusion support.
From your query, we suspect that you want to set page size dynamically based on
the browser layout. Based on your requirement, we prepared sample using Media
Query component based on that we’ll render grid pager size accordingly. We have
attached the code snippet and sample for your reference.
|
<SfMediaQuery @bind-ActiveBreakpoint="@activeBreakpoint"></SfMediaQuery>
@if
(activeBreakpoint == "Medium")
{
pagesize = 10;
}
else
{
pagesize = 15;
}
<SfGrid DataSource="@Orders" AllowPaging="true">
<GridPageSettings PageSize="@pagesize"></GridPageSettings>
@code
{
private string
activeBreakpoint;
public
int pagesize { get; set; } = 10;
protected override void
OnInitialized()
{
SfMediaQuery.Small.MediaQuery
= "(max-width:
500px)";
SfMediaQuery.Medium.MediaQuery = "(max-width: 1027px)";
SfMediaQuery.Large.MediaQuery = "(min-width: 1366px)";
base.OnInitialized();
}
}
|
If you have any further queries, please get back to us.
Regards,
Sarvesh
Attachment:
BlazorAppPaging_204bfe02.zip