Windows Form DataGridView - RowValidating Event Not Firing

I'm Developing a Windows Forms application with a datagridview bound to a datasource. In the process of validating some cell values the RowValidating Event does not fire when navagation moves off the row. Works fine moving to Next Row. However, if i change a cell value, Tab back to the left to another cell on the same row, then use the mouse to click on a Previous row above the changed row..... the RowValidating Event does not occur.
Example::
   A B  C D
1 x  x  x  x
2 x  x  x  x
3 x  x  x  x

If I change the value in C2, then backtab (or mouse click) back to B2, Then mouse click on any cell in row 1, the RowValidation Event does not fire and thus the changed value in C2 does not get evaluated. I am manually handling the Datasource Update which is dependant on the validations. Please advise ...
mpharisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Jorge PaulinoIT Pro/DeveloperCommented:
That's a validation for the row, not for the cells. Use CellValidating event instead
0
 
mpharisAuthor Commented:
Therein lies the initial problem. I am using CellValidating but if one cell is dependant on another I cannot navagate away from the invalid cell to change the parent cell controlling the validation logic. Example:
I have both a "Company" column and a "Division" Column. Both columns may have a valid entry for each independent cell but there are only certain valid "Divisions" for a given "Company". I was attempting to use Cell validation for the individual values and then apply RowValidating to ensure the validity of the group "Company and Division".  Otherwise,  a valid company and division would pass the first line of validations and allow the Update of an Invalid Company/Division combination.
I'm open to other approach to this kind of issue?
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Can you show what you're doing ?
0
 
mpharisAuthor Commented:
Let me diverge from the intial description to the REAL Issue.
  The idea revolves around a product ID column of an order detail line in a datagridview. I'd like the user to have the option of typing in the product ID or clicking a "Button" in the next column which would display another Gridview (like a Pop-Up) and allow the customer to select the product ID. The concept is to have a button column which the user could click if he/she input the wrong ID and select the Correct One.
   The problem, if the user inputs an invlaid Product ID, CellValidating Fires and prevents the user from navagating away and clicking the Button which would display the valid options to select from. I'm not sure how to handle the scenario so I tried using the RowValidating event for the Product ID to allow for the Button Selection. Sorry for the confusing description. Does what i'm attempting make sense?
Note-I'm using a second datagridview instead of a combobox column in my initial DGV because i what to provide more information for the user to have availble like description, price, Onhand qty, etc..
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.

All Courses

From novice to tech pro — start learning today.