Articles in this section
Category / Section

How to make Xamarin.Forms DataGrid scroll like an excel sheet?

1 min read

SfDataGrid provides three types of scrolling mode which can be customized using the SfDataGrid.ScrollingMode property. By default, the SfDataGrid will scroll its content based on pixel values.

  • PixelLine
  • Line
  • Pixel

PixelLine

When SfDataGrid.ScrollingMode is PixelLine, the SfDataGrid will scroll its contents like an excel sheet. i.e., whenever a row or a column is clipped on the top, the particular row or column will be auto scrolled to display fully in view.

SfDataGrid sfGrid;
sfGrid = new SfDataGrid();
sfGrid.ScrollingMode = ScrollingMode.PixelLine;

 

C:\Users\INDHUM~1.MAL\AppData\Local\Temp\msohtmlclip1\02\clip_image001.png


Line Scrolling

When SfDataGrid.ScrollingMode is Line, the SfDataGrid will scroll its contents based on lines. i.e., the view will be updated only when the offset values reaches the origin of a row or column in the bound collection.

SfDataGrid sfGrid;
sfGrid = new SfDataGrid();
sfGrid.ScrollingMode = ScrollingMode.Line;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 





Pixel Scrolling

When SfDataGrid.ScrollingMode is Pixel, the SfDataGrid will scroll its contents based on pixel values. i.e., the view will be updated each pixel change of the offsets and rows or columns will appear clipped when offset exceeds the origin of the row or column.

SfDataGrid sfGrid;
sfGrid = new SfDataGrid();
sfGrid.ScrollingMode = ScrollingMode.Pixel;

 

 



Conclusion

I hope you enjoyed learning about how to make DataGrid scroll like an excel sheet.

You can refer to our Xamarin.Forms DataGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

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 (0)
Please sign in to leave a comment
Access denied
Access denied