You can use below code to make the DataGridCell editable:
private void DataGridCell_GotFocus(object sender, RoutedEventArgs e)
{
DataGridCell cell = sender as DataGridCell;
EditCell(cell, e);
Debug.Print("DataGrid_CellGotFocus: " + e.OriginalSource.ToString())
}
private void EditCell(DataGridCell cell, RoutedEventArgs e)
{
if (cell == null || cell.IsEditing || cell.IsReadOnly)
return;
if (!cell.IsFocused)
{
cell.Focus();
}
MyDataGrid.BeginEdit(e);
cell.Dispatcher.Invoke( DispatcherPriority.Background, new Action(delegate { })
);
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.