Answers for "dataGridView default error dialog handle"

C#
0

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);
}
Posted by: Guest on May-06-2022

C# Answers by Framework

Browse Popular Code Answers by Language