Попробуйте обрабатывать событие
PreviewKeyDown:
private void dataGrid_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Up || e.Key == Key.Down)
{
dataGrid.CancelEdit();
}
}
<DataGrid x:Name="dataGrid" PreviewKeyDown="dataGrid_PreviewKeyDown" ...>