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); }
public void dataGridView1_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { if (e.Context == DataGridViewDataErrorContexts.Formatting || e.Context == DataGridViewDataErrorContexts.PreferredSize) { e.ThrowException = false; } }
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()); }
protected void RaiseDataError(DataGridViewDataErrorEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnDataErrorInternal(e); } }
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"); }
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 = ""; }
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; } }
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); }
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; }
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; }
protected override void OnDataError(bool displayErrorDialogIfNoHandler, System.Windows.Forms.DataGridViewDataErrorEventArgs e) {/* * //base.OnDataError(displayErrorDialogIfNoHandler, e); * DomainModel.ApplicationState.Instance.Controller.UpdateStatus( * new StatusController.Entities.StatusInfo( * (Int16)StatusCodes.Assemblies.Codes.ElectronicMeterProgrammer, * (Int16)StatusCodes.Sections.Codes.Presentation, * StatusController.Abstract.StatusTypes.Error, * (Int32)StatusCodes.Errors.Codes.DataError, * null, e.Exception.ToString()));*/ }
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; } }
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."); } }
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; } }
// 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; }
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"); } }
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"); } }
private void kelompokProdukDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) { try { this.Validate(); this.kelompokProdukBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.stock_Data); } catch (NullReferenceException ee) { } catch (ConstraintException ce) { MessageBox.Show("Duplikasi kode kelompok, silakan input kode kelompok yang unik"); } }
private void loginDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) { try { this.Validate(); this.loginBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.login_Data); } catch (NoNullAllowedException nonullallowed_e) { MessageBox.Show("Nama " + prefix + " harus diisi."); } catch (ConstraintException ee) { MessageBox.Show("Duplikasi id " + prefix + ", silakan input id " + prefix + " yang unik"); } }
private void DataGridView_DataError( object sender, DataGridViewDataErrorEventArgs e ) { MessageBox.Show( "Error happened " + e.Context.ToString() ); if ( e.Context == DataGridViewDataErrorContexts.Commit ) { MessageBox.Show( "Commit error" ); } if ( e.Context == DataGridViewDataErrorContexts.CurrentCellChange ) { MessageBox.Show( "Cell change" ); } if ( e.Context == DataGridViewDataErrorContexts.Parsing ) { MessageBox.Show( "parsing error" ); } if ( e.Context == DataGridViewDataErrorContexts.LeaveControl ) { MessageBox.Show( "leave control error" ); } if ( ( e.Exception ) is ConstraintException ) { DataGridView view = (DataGridView)sender; view.Rows[e.RowIndex].ErrorText = "an error"; view.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = "an error"; e.ThrowException = false; } }
private void dgvLogData_DataError(object sender, DataGridViewDataErrorEventArgs e) { Record.execFileRecord(e.Exception.Message); e.Cancel = true; }
private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e) { MessageBox.Show("���ݸ�ʽ������������д��", "��ʾ��Ϣ", MessageBoxButtons.OK, MessageBoxIcon.Error); }
void HandleDataError(object sender, swf.DataGridViewDataErrorEventArgs e) { // ignore errors to prevent ugly popup when clearing data Debug.WriteLine("Data Error: {0}", e.Exception); }
// Public Sub unselectAllShortCuts() // For Each oRow As DataGridViewRow In DataGridViewSetShortCut.Rows // oRow.Selected = False // Next // End Sub private void editSetsError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { MessageBox.Show("edit sets error"); }
public object GetValue(int boundColumnIndex, int columnIndex, int rowIndex) { Debug.Assert(rowIndex >= 0); object value = null; try { value = this.props[boundColumnIndex].GetValue(this.currencyManager[rowIndex]); } catch (Exception exception) { if (ClientUtils.IsCriticalException(exception) && !(exception is IndexOutOfRangeException)) { throw; } DataGridViewDataErrorEventArgs dgvdee = new DataGridViewDataErrorEventArgs(exception, columnIndex, rowIndex, DataGridViewDataErrorContexts.Display); this.owner.OnDataErrorInternal(dgvdee); if (dgvdee.ThrowException) { throw dgvdee.Exception; } } return value; }
private void dgvPRPlanInfo_DataError(object sender, DataGridViewDataErrorEventArgs e) { e.Cancel = true; }
private void comprasDetDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) { MessageBox.Show("Error de Formato",this.Text,MessageBoxButtons.OK,MessageBoxIcon.Information); }
private void DataGridView_Sudoku_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { //MessageBox.Show("Exception: row = " + e.RowIndex + " col = " + e.ColumnIndex + "\n\n" + e.ToString(), "DataGridView_Sudoku_DataError", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
void dgvDevices_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { // I dunno what the deal is with this, but the DGV hates me. }
private void dgvOverview_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { //For erasing DefaultErrorDialog }
private void DataGridView1_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { e.Cancel = true; }
private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e) { e.ThrowException = false; e.Cancel = false; }
private void dgItem_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { }
private void dataGridViewX1_DataError(object sender, DataGridViewDataErrorEventArgs e) { e.Cancel = true; }
/// <summary> /// Handling data error /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvAdditionalCost_DataError(object sender, DataGridViewDataErrorEventArgs e) { try { if (e.Exception.Message == "DataGridViewComboBoxCell value is not valid.") { object value = dgvAdditionalCost.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; if (!((DataGridViewComboBoxColumn)dgvAdditionalCost.Columns[e.ColumnIndex]).Items.Contains(value)) { e.ThrowException = false; } } } catch (Exception ex) { MessageBox.Show("SJ:73" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
void dataGridView1_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { }
private void pagosDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) { MessageBox.Show("Error de Formato"); }
protected override void OnDataError(bool displayErrorDialogIfNoHandler, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { e.Cancel = true; e.ThrowException = false; ErrorHandler(this, e.Exception); }
public string GetError(int boundColumnIndex, int columnIndex, int rowIndex) { Debug.Assert(rowIndex >= 0); IDataErrorInfo errInfo = null; try { errInfo = this.currencyManager[rowIndex] as IDataErrorInfo; } catch (Exception exception) { if (ClientUtils.IsCriticalException(exception) && !(exception is IndexOutOfRangeException)) { throw; } DataGridViewDataErrorEventArgs dgvdee = new DataGridViewDataErrorEventArgs(exception, columnIndex, rowIndex, DataGridViewDataErrorContexts.Display); this.owner.OnDataErrorInternal(dgvdee); if (dgvdee.ThrowException) { throw dgvdee.Exception; } } if (errInfo != null) { return errInfo[this.props[boundColumnIndex].Name]; } else { return String.Empty; } }
private void gridWeightData_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { MessageBox.Show("非法数字,请重新输入"); }
public void ProcessException(Exception exception, DataGridViewCellCancelEventArgs e, bool beginEdit) { DataGridViewDataErrorEventArgs dgvdee = new DataGridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, // null, // null, DataGridViewDataErrorContexts.Commit); this.owner.OnDataErrorInternal(dgvdee); if (dgvdee.ThrowException) { throw dgvdee.Exception; } else if (dgvdee.Cancel) { e.Cancel = true; if (beginEdit) { IEditableObject iEditObj = this.currencyManager.Current as IEditableObject; if (iEditObj != null) { iEditObj.BeginEdit(); } } } else { CancelRowEdit(false /*restoreRow*/, false /*finishedAddNew*/); // interrupt current operation } }
// If a check box cell is clicked, this event handler disables // or enables the button in the same row as the clicked cell. // Private Sub fixButtonForIndividualParams(ByVal oRow As DataGridViewRow) // Dim oStyleFound As NewDog DataGridViewCellStyle // Dim thisData As ClassOneParamAssociation = oRow.DataBoundItem // Dim thisDrawingColor = NewDog System.Drawing.Color // Dim buttonColor As NewDog System.Drawing.Color // Dim buttonText As String = "" // Dim buttonEnabled As Boolean = False // If thisData.parameterFoundInThisFileBool Then // thisDrawingColor = myColorGood // buttonColor = myColorGood // buttonText = "none" // buttonEnabled = False // Else // thisDrawingColor = myColorWarning // buttonColor = myColorWarning // buttonText = "create ->" // buttonEnabled = True // End If // oStyleFound.BackColor = thisDrawingColor // 'oStyleFound.ForeColor = thisDrawingColor // 'oRow.Cells(2).Style = oStyleFound // oRow.Cells("parameterFoundInThisFileBool").Style = oStyleFound // 'oRow.Cells("existColorSwatch").Value = "xxx" // Dim cell As DataGridViewCell = oRow.Cells("ColumnCreateParam") // cell.Style.BackColor = buttonColor // With oRow.Cells("ColumnCreateParam") // .Value = buttonText // .Style = oStyleFound // End With // '----------------------------------------------------------------------- // '--- make sure the parameter is text // If thisData.parameterFoundInThisFileBool Then // Dim oStyleIsText As NewDog DataGridViewCellStyle // 'oStyleIsText.BackColor = myColorGood // 'Else // ' oStyleIsText.BackColor = myColorError // ' warningText += thisData.thisParameterName & vbCrLf // End If // ' oRow.Cells("paramIsTextStr").Style = oStyleIsText // ' // ' End If // ' // '--------------------- // End Sub // Private Sub createTheDropBox() // If isFirstBinding Then // Dim cmb As NewDog DataGridViewComboBoxColumn // cmb.HeaderText = "Select Data" // cmb.ParameterDefinitionName = "cmb" // cmb.MaxDropDownItems = 2 // cmb.Items.Add("True") // cmb.Items.Add("False") // DataGridViewFromFile.Columns.Add(cmb) // isFirstBinding = False // End If // End Sub // Dim warningText As String = "" // For Each oRow As DataGridViewRow In DataGridViewFromFile.Rows // fixButtonForIndividualParams(oRow) // Next // If warningText.Length > 0 And Not warningIssued Then // warningIssued = True // End If // End Sub private void DataGridViewSetShortCut_DataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { MessageBox.Show(("data error in DataGridViewSetShortCut. " + e.ToString())); }
/// <summary> /// Handling dataerror /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvServiceVoucher_DataError(object sender, DataGridViewDataErrorEventArgs e) { try { e.ThrowException = false; } catch (Exception ex) { MessageBox.Show("SV 54 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
protected override void OnDataError(bool displayErrorDialogIfNoHandler, System.Windows.Forms.DataGridViewDataErrorEventArgs e) { base.OnDataError(false, e); }