Articles in this section
Category / Section

How to have different page size in Xamarin.Forms DataGrid?

1 min read

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.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or 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
Please  to leave a comment
Access denied
Access denied