PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms DataGridView Dirty Pen

Reply

DataGridView Dirty Pen

 
Thread Tools Rate Thread
Old 05-01-2007, 12:06 AM   #1
John Rivers
Guest
 
Posts: n/a
Default DataGridView Dirty Pen


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

  Reply With Quote
Old 05-01-2007, 02:07 AM   #2
ClayB
Guest
 
Posts: n/a
Default Re: DataGridView Dirty Pen

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.

  Reply With Quote
Old 05-01-2007, 06:04 PM   #3
John Rivers
Guest
 
Posts: n/a
Default Re: DataGridView Dirty Pen



And how will solve the broken Dirty Pen problem?




On Jan 5, 2:07 am, "ClayB" <c...@syncfusion.com> wrote:
> 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.


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off