Solved

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

Posted on 2013-11-20
4
664 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

832 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