Beispiel #1
0
 public void RemoveSelectedRoleEvent()
 {
     // DataRow
     System.Data.DataRowView dataRowView = this.listBoxRoleEvents.SelectedItem as System.Data.DataRowView;
     if (dataRowView != null)
     {
         dataRowView.Delete();
     }
 }
Beispiel #2
0
 private void btnRemoveLine_Click(object sender, RoutedEventArgs e)
 {
     if (grdData.SelectedItem == null)
     {
         System.Windows.MessageBox.Show("Please select a line");
         return;
     }
     System.Data.DataRowView drv = (System.Data.DataRowView)grdData.SelectedItem;
     drv.Delete();
 }
Beispiel #3
0
 private void removeBtn_Click(object sender, RoutedEventArgs e)
 {
     // bool confirm = System.Windows.Forms.MessageBox.Show(, MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
     if ((int)System.Windows.Forms.MessageBox.Show("Are you sure to delete?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) != 1)
     {
         return;
     }
     else
     {
         if (grdData.SelectedItem == null)
         {
             System.Windows.MessageBox.Show("Please select a line");
             return;
         }
         System.Data.DataRowView drv = (System.Data.DataRowView)grdData.SelectedItem;
         drv.Delete();
     }
 }