Show summation in groupCaptionTitleFormat
In flutter, Sfdatagrid i want to show the summation of particular column in
groupCaptionTitleFormat.
Hi Umang,
As of now, the DataGrid does not have support for the caption summary row within grouping . We have already considered your request as a feature. We will implement this feature in any of our upcoming releases. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We appreciate your patience and understanding until then. You can follow up with the below feedback for further details,
Feedback link: 53098
Regards,
Abinesh P
hi
Abinesh ,
Thank you for the quick response. Also i have one small query is it possible to get the current sfdatagrid data as list on tap of button. I need the data which is showin in sfdatagrid after filtering and sorting so how should i do that?
Hi
Umang,
In SfDataGrid, you can fetch the rows displayed in the UI, even when filtering
or sorting is applied, by using DataGridSource.effectiveRows.
Below is a code snippet for reference.
Code snippets:
|
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Syncfusion Flutter DataGrid'), ), body: Column( children: [ TextButton( onPressed: () { // Fetch the rows displayed in the UI. List<DataGridRow> currentRows = employeeDataSource.effectiveRows; }, child: const Text('Get RowData')), Expanded( child: SfDataGrid( source: employeeDataSource, allowFiltering: true, allowSorting: true, columnWidthMode: ColumnWidthMode.fill, columns: <GridColumn>[ GridColumn( columnName: 'id', label: Container( padding: const EdgeInsets.all(16.0), alignment: Alignment.center, child: const Text( 'ID', ))), GridColumn( columnName: 'name', label: Container( padding: const EdgeInsets.all(8.0), alignment: Alignment.center, child: const Text('Name'))), GridColumn( columnName: 'designation', label: Container( padding: const EdgeInsets.all(8.0), alignment: Alignment.center, child: const Text( 'Designation', overflow: TextOverflow.ellipsis, ))), GridColumn( columnName: 'salary', label: Container( padding: const EdgeInsets.all(8.0), alignment: Alignment.center, child: const Text('Salary'))), ], ), ), ], ), ); } |
Regards,
Abinesh P