Solved

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

Posted on 2013-11-20
4
676 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
  • 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 500 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.

831 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