本文整理汇总了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);
}
示例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());
}
示例3: RaiseDataError
protected void RaiseDataError(DataGridViewDataErrorEventArgs e)
{
if (this.dataGridView != null)
{
this.dataGridView.OnDataErrorInternal(e);
}
}
示例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");
}
示例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 = "";
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
}
示例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.");
}
}
示例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;
}
}
示例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;
}
示例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");
}
}
示例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");
}
}