當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.DataGridViewDataErrorEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Forms.DataGridViewDataErrorEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# DataGridViewDataErrorEventArgs類的具體用法?C# DataGridViewDataErrorEventArgs怎麽用?C# DataGridViewDataErrorEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataGridViewDataErrorEventArgs類屬於System.Windows.Forms命名空間,在下文中一共展示了DataGridViewDataErrorEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: bitacoraGrid_DataError

 private void bitacoraGrid_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     /* Evento cuando ocurre un error en los datos */
     if (e.Context == DataGridViewDataErrorContexts.Commit)
         Program.main.statusStrip.Text = "Error, porfavor corrija el dato en la celda (" + e.RowIndex + "," + e.ColumnIndex + ").";
         //MessageBox.Show("Error, porfavor corrija el dato en la celda (" + e.RowIndex + "," + e.ColumnIndex + ").","Error",MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
 }
開發者ID:BigChief45,項目名稱:LawHelper,代碼行數:7,代碼來源:ByH.cs

示例2: dgvStatVarProperties_DataError

 private void dgvStatVarProperties_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     Debug.WriteLine(e.Exception.Message);
     Debug.WriteLine(e.ColumnIndex);
     Debug.WriteLine(e.RowIndex);
     Debug.WriteLine(e.ToString());
 }
開發者ID:runarbe,項目名稱:Avinet.Adaptive.Statistics.ExcelAddIn,代碼行數:7,代碼來源:UploadForm.StatVarGrid.cs

示例3: RaiseDataError

 protected void RaiseDataError(DataGridViewDataErrorEventArgs e)
 {
     if (this.dataGridView != null)
     {
         this.dataGridView.OnDataErrorInternal(e);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:DataGridViewElement.cs

示例4: productsDataGridView_DataError

 private void productsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     int row = e.RowIndex + 1;
     string errorMessage = "A data error occurred.\n" +
         "Row: " + row + "\n" +
         "Error: " + e.Exception.Message;
     MessageBox.Show(errorMessage, "Data Error");
 }
開發者ID:fakeshark,項目名稱:CSharpProjects,代碼行數:8,代碼來源:Form1.cs

示例5: RemoteBranchesDataError

        private void RemoteBranchesDataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            MessageBox.Show(this,
                string.Format(_remoteBranchDataError.Text, RemoteBranches.Rows[e.RowIndex].Cells[0].Value,
                    RemoteBranches.Columns[e.ColumnIndex].HeaderText));

            RemoteBranches.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "";
        }
開發者ID:Carbenium,項目名稱:gitextensions,代碼行數:8,代碼來源:FormRemotes.cs

示例6: DataGridView_DataError

 private void DataGridView_DataError( object sender, DataGridViewDataErrorEventArgs e )
 {
     MessageBox.Show( "Error happened " + e.Context.ToString() + "\n Exception Message: " + e.Exception.Message );
     if ( ( e.Exception ) is ConstraintException ) {
         DataGridView view = (DataGridView)sender;
         view.Rows[e.RowIndex].ErrorText = "an error";
         e.ThrowException = false;
     }
 }
開發者ID:WaterskiScoring,項目名稱:WaterskiScoringSystem,代碼行數:9,代碼來源:TrickListMaint.cs

示例7: productsDataGridView_DataError

        private void productsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            int row = e.RowIndex + 1;
            int col = e.ColumnIndex + 1;

            string strErrorMessage = "A data error occurred.\nRow: " + row +
                                     ", Column: " + col + "\nError: " + e.Exception.Message;
            MessageBox.Show(strErrorMessage, "Data Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
開發者ID:anneilb,項目名稱:ce-dev,代碼行數:9,代碼來源:frmProductMaintenance.cs

示例8: timeLogView_DataError

 private void timeLogView_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     string columnName = this.timeLogView.Columns[e.ColumnIndex].HeaderText;
     if(e.ColumnIndex == 1)
         ShowErrorMessage(Constants.PleaseEnterNotEmptyActivityName,
                         String.Format(Constants.IncorrectValueInColumn, columnName));
     else
         ShowTimeNotValidMessage(columnName);
     e.Cancel = true;
 }
開發者ID:gayancc,項目名稱:lazycure-code,代碼行數:10,代碼來源:TimeLogEditor.cs

示例9: CellDataError

 public static void CellDataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     e.Cancel = true;
     e.ThrowException = false;
     if ((e.RowIndex != -1) && (e.ColumnIndex != -1))
     {
         (sender as DataGridView).Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = e.Exception.Message;
     }
     else
         e.ThrowException = true;
 }
開發者ID:UGTU,項目名稱:UGTUKadrProject,代碼行數:11,代碼來源:DataGridViewHelper.cs

示例10: gridClasses_DataError

        private void gridClasses_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            ConstraintException ex = e.Exception as ConstraintException;
              if (ex != null) {
            MessageBox.Show(this, "The name has already been used. Please use a unique Class Name.",
              Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            e.ThrowException = false;

              } else {
            e.ThrowException = true;

              }
        }
開發者ID:oobayly,項目名稱:LDYC-Trophies,代碼行數:13,代碼來源:EditClassesDialog.cs

示例11: accountDataGridView_DataError

 private void accountDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     try
     {
         this.Validate();
         this.accountBindingSource.EndEdit();
         this.tableAdapterManager.UpdateAll(this.master_Data);
     }
     catch (NoNullAllowedException nonullallowed_e)
     {
         MessageBox.Show("id " + prefix + " harus diisi.");
     }
 }
開發者ID:aldowrable,項目名稱:accountingsolution,代碼行數:13,代碼來源:Modul_Akuntansi_KodePerkiraan.cs

示例12: DataGridView_DataError

 private void DataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     if (e.Exception.GetType() == typeof(FormatException))
     {
         MessageBox.Show("Invalid value entered", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         e.Cancel = false;
         e.ThrowException = false;
     }
     else
     {
         MessageBox.Show("An unexpected error has occured:\n" + e.Exception, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         e.Cancel = false;
         e.ThrowException = false;
     }
 }
開發者ID:phinixx14,項目名稱:Property-Managment,代碼行數:15,代碼來源:ViewOccurenceDataForm.cs

示例13: mcyclesBindingSource_DataError

        // An error in the data occurred.
        private void mcyclesBindingSource_DataError(object sender,
            DataGridViewDataErrorEventArgs e)
        {
            // Don't throw an exception when we're done.
            e.ThrowException = false;

            // Display an error message.
            string txt = "Error with " +
                //mcycles.Columns[e.ColumnIndex].HeaderText +
                "\n\n" + e.Exception.Message;
            MessageBox.Show(txt, "Error",
                MessageBoxButtons.OK, MessageBoxIcon.Error);

            // If this is true, then the user is trapped in this cell.
            e.Cancel = false;
        }
開發者ID:Seosamhoc,項目名稱:mockAss,代碼行數:17,代碼來源:frmBikes.cs

示例14: jasaDokterDataGridView_DataError

 private void jasaDokterDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     try
     {
         this.Validate();
         //this.jasaDokterBindingSource.EndEdit();
         //this.tableAdapterManager.UpdateAll(this.penjualan_Data);
     }
     catch (NullReferenceException ee)
     {
     }
     catch (ConstraintException ee)
     {
         MessageBox.Show("Duplikasi Kode Jasa, silakan input Kode Jasa yang unik");
     }
 }
開發者ID:aldowrable,項目名稱:accountingsolution,代碼行數:16,代碼來源:Modul_Data_JasaDokter.cs

示例15: bankDataGridView_DataError

 private void bankDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
 {
     try
     {
         this.Validate();
         this.bankBindingSource.EndEdit();
         this.tableAdapterManager.UpdateAll(this.master_Data);
     }
     catch (NullReferenceException ee)
     {
     }
     catch (ConstraintException ee)
     {
         MessageBox.Show("Duplikasi ID Bank, silakan input ID Bank yang unik");
     }
 }
開發者ID:aldowrable,項目名稱:accountingsolution,代碼行數:16,代碼來源:Modul_Data_Bank.cs


注:本文中的System.Windows.Forms.DataGridViewDataErrorEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。