Articles in this section

How to have different page size in .NET MAUI DataGrid?

The .NET MAUI DataGrid allows you to set different page sizes based on the device’s orientation by overriding the OnSizeAllocated method to specify the size of the data pager.

The code example below illustrates how to adjust the page size dynamically when the device orientation changes between horizontal and vertical:

protected override void OnSizeAllocated(double width, double height)
{
    if (width > height)
        dataPager.PageSize = 5;
    else
        dataPager.PageSize = 10;
    base.OnSizeAllocated(width, height);
}

Download the complete sample from GitHub.

Conclusion

I hope you enjoyed learning how to set different page sizes in Data Pager with .NET MAUI DataGrid when the device is in horizontal and vertical orientation modes.

You can refer to our .NET MAUI DataGrid feature tour page to learn about its other groundbreaking feature representations. Explore our .NET MAUI DataGrid Documentation to understand how to present and manipulate data.
For current customers, check out our .NET MAUI components on the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to explore our .NET MAUI DataGrid and other .NET MAUI components.

Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac or feedback portal, or the feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied