Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi guys,

Is there anyway which I can have cell validation after I click the load data button and before displaying data in datagridview??
I know I that I can have cell validation when editing in datagridview. However I want viewer's to first see the errors first and then edit.

Please, need for help.

What I have tried:

Import datalist from excel after clicking load button. cell validation when editing.
Updated 24-Jun-20 22:02pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Until you display the DGV, you can't show the user anything is a useful form. So you would need to either validate the datasource before you apply the data to the DGV - which isn't difficult, though "fixes" may be laborious depending on your data - or you could use the DGV to show "errors" in a different colour perhaps: Colouring DataGridView Cells According to their Content in WinForms[^] may help. he code is C#, but it's pretty obvious and you'd need to use your own validation anyway.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100