RE: dataGridView Cell Parsing Error ESC



Hi Chuck,

If the user then presses ESC, the cells value returns to the original
value but the error message remains. How can you clear the message if the
user ESCs out of the cell edit?

In this scenario, the CellEndEdit event of the datagridview is raise. You
could handle this event to clear the error message. Below is a sample of
handling the CellEndEdit event.

void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
this.dataGridView1.Rows[e.RowIndex].ErrorText = "";
}

You can also inherite a new class from DataGridView and override the
OnCellEndEdit method to clear the current row's error text. Below is a
sample.

class MyDataGridView : DataGridView
{
protected override void OnCellEndEdit(DataGridViewCellEventArgs e)
{
this.Rows[e.RowIndex].ErrorText = "";
base.OnCellEndEdit(e);
}
}

Hope this helps.
If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • RE: application failed to initialize - Visual Studio 2005 with or with
    ... customers complaining the lack of information from OS loader. ... the explorer error dialog is the standard error message for Win32 error ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.debugging)
  • RE: Deploying WCF
    ... If you use this address in your client application ... Allowed" error message from IIS. ... Microsoft Online Community Support ... nature are best handled working with a dedicated Microsoft Support Engineer ...
    (microsoft.public.dotnet.framework)
  • Re: Access Violation in SQL Server Native Client
    ... sorry I thought an "Access Violation Exception" is clear enough, so I don't translated the German error message. ... Best Regards ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.sqlserver.odbc)
  • RE: MailMessage-Object error - net 1.1 , VS 2003
    ... According to this error message, I've performed some research, it seems ... this exception message is quite general (may be raised by different kind of ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)
  • RE: dwi.exe error
    ... I restored the system to 7-4 and rebooted and received the error message. ... took off of Windows update but SP3 is gone. ... see Help and Support Center at ... Card with network address 001FE15E3794 is already in use on the network. ...
    (microsoft.public.windowsxp.help_and_support)