Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 826
  • Last Modified:

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

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
dominicwong
Asked:
dominicwong
  • 2
  • 2
1 Solution
 
Jacques Bourgeois (James Burger)PresidentCommented:
Set the ErrorText property of the cell to an empty string.
0
 
dominicwongAuthor Commented:
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
 
Jacques Bourgeois (James Burger)PresidentCommented:
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
 
dominicwongAuthor Commented:
Thanks James
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now