Eyal Lewin

Eyal Lewin

  • NA
  • 18
  • 0

DataGridViewDataErrorContexts

Mar 22 2010 8:03 AM
 Can anybody explain to me how I handle the DataError Event? I have the
following code but the error does not get picked up by any of them. Looking
at e.Context shows " Parsing | Commit | CurrentCellChange ", how do I get
the individual values?

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");
}

Answers (1)