Articles in this section
Category / Section

How to Cancel Editing a Cell in Flutter DataTable (SfDataGrid)?

1 min read

In this article, we will show how to cancel editing a cell in Flutter DataTable.

Initialize the SfDataGrid widget with the necessary properties. The DataGridSource.onCellBeginEdit method is called when a cell enters edit mode. This method provides the row, rowColumnIndex, and column as parameters. You can use these parameter values to determine whether editing should proceed. Return false if you want to prevent specific cells from entering edit mode

@override
  bool onCellBeginEdit(
    DataGridRow dataGridRow,
    RowColumnIndex rowColumnIndex,
    GridColumn column,
  ) {
    if (column.columnName == 'ID') {
      if (rowColumnIndex.columnIndex == 0 && rowColumnIndex.rowIndex == 2) {
        return false;
      }
    }
    return true;
  }

View the GitHub sample here.

Conclusion
I hope you enjoyed learning how to filer data for Angular Chart series using a specific field.
You can refer to our Flutter DataTable feature tour page to know about its other groundbreaking feature representations and Documentation, and how to quickly get started for configuration specifications. You can also explore our Flutter DataTable example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied