DataGridView Dirty Pen

  • Thread starter Thread starter John Rivers
  • Start date Start date
J

John Rivers

Hello

Cancelling a CellValidating event handler works OK

but

Cancelling a RowValidating event handler causes the "Dirty Pen" to
disappear even though uncommitted proposed value is still in the cell -
hitting ESC will revert the value to the original
so it all works except for the "Dirty Pen"

is it my fault?
is this a bug?
is there a workaround?

Best wishes

John Rivers
 
You may be able to work around this behavior by explicitly calling
CancelEdit in your RowValidating handler when you set e.Cancel = true;

void dataGridView1_RowValidating(object sender,
DataGridViewCellCancelEventArgs e)
{
//......whatever????
e.Cancel = true;
((DataGridView)sender).CancelEdit();
}

===================
Clay Burch
Syncfusion, Inc.
 
Back
Top