When the datagrid has many columns, on mac user can use horizontal scroll using mouse or trackpad dragging to right or left.
On windows, using ^19.2.44-beta.1, user can use leftClick+drag to x scroll, but using ^19.3.45, that scroll type doesn't work anymore.
It's a bug or there's some new parameter to do that?
Thanks in advance
Peter
Hi Pietro Beccegato,
Thank you for contacting Syncfusion support.
The reported issue is the breaking changes from the flutter framework itself during 2.5 version update.
Breaking changes: https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag
You can overcome this issue by adding ScrollConfiguration as parent to the SfDataGrid. Please refer the following code snippet.
|
@override Widget build(BuildContext context) { return Scaffold( body: ScrollConfiguration( behavior: ScrollConfiguration.of(context).copyWith(dragDevices: { PointerDeviceKind.touch, PointerDeviceKind.mouse, }), child: SfDataGrid( source: _employeeDataSource, showCheckboxColumn: true, selectionMode: SelectionMode.multiple, columns: [ GridColumn( columnName: 'id', label: Container( padding: const EdgeInsets.symmetric(horizontal: 16.0), alignment: Alignment.centerRight, child: const Text( 'ID', overflow: TextOverflow.ellipsis, ))), GridColumn( columnName: 'name', label: Container( padding: const EdgeInsets.symmetric(horizontal: 16.0), alignment: Alignment.centerLeft, child: const Text( 'Name', overflow: TextOverflow.ellipsis, ))), GridColumn( columnName: 'designation', label: Container( padding: const EdgeInsets.symmetric(horizontal: 16.0), alignment: Alignment.centerLeft, child: const Text( 'Designation', overflow: TextOverflow.ellipsis, ))), GridColumn( columnName: 'salary', label: Container( padding: const EdgeInsets.symmetric(horizontal: 16.0), alignment: Alignment.centerRight, child: const Text( 'Salary', overflow: TextOverflow.ellipsis, ))) ]))); } |
We have prepared the sample for your reference. Please find the sample from the following link.
Sample link: https://www.syncfusion.com/downloads/support/forum/169769/ze/main1318479174
We hope this information is useful to you. Please let us know if you would require any further assistance.
Regards,
Sangeetha Raju
Many many thanks.
With "ScrollConfiguration(....." works perfectly.
Regards
Peter
Hello Raju, can I use your assistance with the Datagrid widget?
David,
Please include more details about your query. This would be helpful for us to serve you.