Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to remove Error Icon from DataGridViewCell in winform and C# .NET3.5

Posted on 2013-11-20
4
Medium Priority
?
756 Views
Last Modified: 2013-11-24
Hi experts
How to programmatically remove an Error Icon inside a DataGridViewCell in winform and C# .NET 3.5?

Some Internet article says "DataRow.Clear". But my datagridvew is not bound to any DataTable.

Mine is bound to a BindingSource, and the DataSource of this BindingSource is bound to a BindingList.

Thanks.
0
Comment
Question by:dominicwong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40
ID: 39665005
Set the ErrorText property of the cell to an empty string.
0
 

Author Comment

by:dominicwong
ID: 39665011
Thanks JamesBurger for your prompt response.
I did try to set it to string.empty. The error text is gone but the error icon stays. I need to click somewhere else before the error icon disappears.
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 39665044
The cursor is probably still in the cell. The icon updates only when you move out of the cell, so move it to the next cell, which should not be a problem because you usually remove the icon once the data in the cell is validated.
0
 

Author Closing Comment

by:dominicwong
ID: 39673327
Thanks James
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question