コード例 #1
0
 private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (DataGrid.SelectedItems.Count > 0)
     {
         EditBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
 }
コード例 #2
0
 private void DataGrid_KeyDown(object sender, KeyEventArgs e)
 {        // удаление из базы по нажатию на Del
     if (e.Key == Key.Delete)
     {
         RemoveBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
     else if (e.Key == Key.Enter)
     {
         EditBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
 }