1
Reply

DataGridViewDataErrorContexts

Eyal Lewin

Eyal Lewin

Mar 22 2010 8:03 AM
4.2k
 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)