Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syncfusion_flutter_datagrid cell textAligment #44

Closed
waqaryounusjatt788 opened this issue Nov 5, 2020 · 2 comments
Closed

syncfusion_flutter_datagrid cell textAligment #44

waqaryounusjatt788 opened this issue Nov 5, 2020 · 2 comments

Comments

@waqaryounusjatt788
Copy link

I have seen when we showing data cell
cellStyle: DataGridCellStyle(
textStyle: TextStyle(fontSize: 10,),)
aligment of Text is missing please add Text Aligment its by default aligment left is showing

center, right etc is not showing just pass aligment params inside DataGridCellStyle() constructor

@NeelakandanKannan
Copy link
Collaborator

NeelakandanKannan commented Nov 6, 2020

Hi @waqaryounusjatt788,

Thanks for contacting Syncfusion support.

We have provided the appearance oriented APIs in DataGridCellStyle class. We have provided the alignment, padding, and all other formatting related APIs in GridColumn itself. Please find the below code snippet and UG documentation to achieve your requirement,

https://help.syncfusion.com/flutter/datagrid/column-types#set-alignment-for-column

@override
Widget build(BuildContext context) {
  return Scaffold(
    body: SfDataGrid(
      source: _employeeDataSource,
      columns: [
        GridNumericColumn(mappingName: 'id', headerText: 'ID')
          ..textAlignment = Alignment.center
          ..headerTextAlignment = Alignment.center,
        GridTextColumn(mappingName: 'name', headerText: 'Name'),
        GridTextColumn(mappingName: 'designation', headerText: 'Designation'),
        GridNumericColumn(mappingName: 'salary', headerText: 'Salary')
      ],
    ),
  );
}

@waqaryounusjatt788
Copy link
Author

Thanks @NeelakandanKannan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants