Esempio n. 1
0
 private void XN002_EditValueChanging(object sender, ChangingEventArgs e)
 {
     if (e.NewValue.ToString() == "")
     {
         e.Cancel = false;
         return;
     }
     if (e.NewValue == e.OldValue)
     {
         e.Cancel = true;
         return;
     }
     else
     {
         if (MessageBox.Show("切換種類將會清除單身已建資料!\r\n是否確定?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             e.Cancel    = false;
             XN003.Text  = "";
             XN003C.Text = "";
             while (GV_Body.RowCount > 0)
             {
                 GV_Body.SelectAll();
                 GV_Body.DeleteSelectedRows();
             }
         }
         else
         {
             e.Cancel = true;
         }
     }
 }