2016-04-19 3 views

Antwort

1

Es scheint, Datenraster nicht selbst konzentrieren, wenn diese Schaltfläche geklickt wird, so dass Sie es selbst zu beheben haben:

dataGrid.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, OnDataGridSelectAll)); 

Und dann:

private void OnDataGridSelectAll(object sender, ExecutedRoutedEventArgs e) { 
    var grid = (DataGrid)sender; 
    grid.Focus(); 
    grid.SelectAll(); 
} 

Sie können auch Bindungs ​​Befehl hinzufügen, in Xaml, wenn Sie so wollen.