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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top