troubleshooting Question

Visual Studio 2008: Validating DataGridView Per Row NOT Per Cell

Avatar of gkinu
gkinu asked on
.NET ProgrammingExchange
3 Comments1 Solution578 ViewsLast Modified:
Am using a DataGridView whose datasource is a typed DataSet. I want to validate per row NOT per cell i.e. even if a value in a cell is erroneous, it should wait until I want to leave the row.

Currently, I am using the RowValidating event handler to validate the row. In addition, I an using the DataError event handler and setting e.Cancel = false so that even if there is an error, I will still move to another cell. The problem is that the value entered in the cell is cleared, which I do not want because i want to give descriptive errors after I am finished with the whole row.

How do i make the invalid cell value to remain when i move to the next cell?
Arno Koster
Software designer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros