Skip to content

syncfusion_flutter_datagrid cell textAligment #44

Closed

Description

@waqaryounusjatt788

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

Activity

  1. NeelakandanKannan commented on Nov 6, 2020

    @NeelakandanKannan

    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')
          ],
        ),
      );
    }
  2. waqaryounusjatt788 commented on Nov 9, 2020

    @waqaryounusjatt788
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions