beginEdit method

Future<void> beginEdit(
  1. RowColumnIndex rowColumnIndex
)

Begins the edit to the given RowColumnIndex in SfDataGrid.

Implementation

Future<void> beginEdit(RowColumnIndex rowColumnIndex) async {
  if (_dataGridStateDetails != null) {
    final DataGridConfiguration dataGridConfiguration =
        _dataGridStateDetails!();
    if (!dataGridConfiguration.allowEditing ||
        dataGridConfiguration.selectionMode == SelectionMode.none ||
        dataGridConfiguration.navigationMode == GridNavigationMode.row) {
      return;
    }
    if (isCurrentCellInEditing) {
      if (!await dataGridConfiguration.currentCell
          .canSubmitCell(dataGridConfiguration)) {
        return;
      }

      await dataGridConfiguration.currentCell
          .onCellSubmit(dataGridConfiguration, cancelCanSubmitCell: true);
    }
    dataGridConfiguration.currentCell.onCellBeginEdit(
        editingRowColumnIndex: rowColumnIndex, isProgrammatic: true);
  }
}