Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

dataGridView default error dialog handle

// Try to Handle and Cancel the event:

private void dataGridView2_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
    e.Cancel = true;
}

// Also, subscribe to the event in InitializeComponent()

private void InitializeComponent()
{
   //...
   this.dataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.dataGridView2_DataError);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dataGridView #default #error #dialog #handle
ADD COMMENT
Topic
Name
5+3 =