I know this question has already been asked for WPF DataGrid but the solutions don't apply to DataGrid from Windows Community Toolkit used in UWP.
You could use SelectionChanged and BeginEdit event to do this like following.
XAML code:
<controls:DataGrid x:Name="dataGrid1"
…
SelectionChanged="dataGrid1_SelectionChanged">
Code behind:
private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
dataGrid1.BeginEdit();
}