How to have different page size in Xamarin.Forms DataGrid?
Xamarin.Forms DataGrid allows you to have different page size when device is in horizontal and vertical orientation mode by overriding the OnSizeAllocated method where we can specify the size of the data pager.
The below code example illustrates how to have different page size, when the device is in horizontal and vertical orientation.
protected override void OnSizeAllocated(double width, double height) { if (width > height) dataPager.PageSize = 5; else dataPager.PageSize = 10; base.OnSizeAllocated(width, height); }
Please find the sample from the below link.
Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Paging781370774
Conclusion
I hope you enjoyed learning about how to have different page size in DataPager with Xamarin.Forms DataGrid when the device is in horizontal and vertical orientation mode.
You can refer to our Xamarin.Forms DataGrid feature tour page to know about its other groundbreaking feature representations. You can also explore our Xamarin.Forms DataGrid documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.