|
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('SfDataGrid Demo')),
body: SfDataGrid(
source: _employeeDataGridSource,
columnWidthMode: ColumnWidthMode.fill,
footer: _employeeDataGridSource.rows.isEmpty
? Container(
color: Colors.lightBlue[50],
child: const Center(child: Text('Data is empty')))
: null,
columns: [
GridColumn(
columnName: 'id',
autoFitPadding: const EdgeInsets.symmetric(horizontal: 16.0),
label: Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerRight,
child: const Text(
'ID',
overflow: TextOverflow.ellipsis,
))),
GridColumn(
columnName: 'name',
autoFitPadding: const EdgeInsets.symmetric(horizontal: 16.0),
label: Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft,
child: const Text(
'Name',
overflow: TextOverflow.ellipsis,
))),
GridColumn(
columnName: 'designation',
autoFitPadding: const EdgeInsets.symmetric(horizontal: 16.0),
label: Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft,
child: const Text(
'Designation',
overflow: TextOverflow.ellipsis,
))),
GridColumn(
columnName: 'salary',
autoFitPadding: const EdgeInsets.symmetric(horizontal: 16.0),
label: Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerRight,
child: const Text(
'Salary',
overflow: TextOverflow.ellipsis,
))),
]));
} |
Thank you so much, its work
Hi Asep,
Thank you for the update.
We are glad to know that the reported problem has been resolved at your end. Please let us know if you need further assistance. As always, we are happy to help you out.
Regards,
Sangeetha Raju.
I want to show data is empty if no data after filtering a column, even rows not empty
Hi hariom,
As of now, the DataGrid does not support displaying an empty message when there are no rows. However, we have already considered your request as a feature and plan to implement it in a future release. During the planning stage of each release cycle, we review all open feature requests and prioritize them based on factors such as product vision, technological feasibility, and customer interest. We appreciate your patience and understanding in the meantime. For further details, you can follow up using the feedback link below.
Feedback link: 50967
Regards,
Abinesh P
Hi
hariom,
We are glad to announce that our Essential Studio® 2025 Volume 1 Main Release
V29.1.33 is rolled out with the enhancement of “showing an empty message when
the row count is zero” and is available for download under the following link.
Essential
Studio® 2025 Volume 1 Main Release v29.1.33 is available for download |
Announcements Forums | Syncfusion®
UG - Placeholder
in Flutter DataGrid | DataTable | Syncfusion
We thank you for your support and appreciate your patience in waiting for this
release. Please get in touch with us if you would require any further
assistance.
Regards,
Abinesh P