Link to home
Start Free TrialLog in
Avatar of LiebertUser
LiebertUser

asked on

How do I monitor when a datagrid row is changed? VB 2005 DATAGRID

I have a datagrid bound to a data table with 5 fields.  Two of the fields cannot be null.

All I want to do is find an event that is raised ONLY after the user leaves that row either by clicking on the previous row, next row, new row, whatever.  The reason for this is that I only want to call my dataadapter.update method once after the user leaves the row.  This gives the operator a chance to fill all of the cells in the row before my code attempts to update the database.

I'm finding plenty of events that fire after a column is entered, changed, whatever but nothing that will fire only after the row is exited.  I've got to be overlooking something...

Thanks in advance for your help.
Avatar of Paul_Harris_Fusion
Paul_Harris_Fusion
Flag of United Kingdom of Great Britain and Northern Ireland image

The event is SelectionChanged
If you use DataGridView, you can try event RowLeave.
Avatar of LiebertUser
LiebertUser

ASKER

You wouldn't know of any clever way to pull this off with a datagrid would you?
I'm a VB6 programmer who inherited this program to support so I still struggle with this .net environment a bit.
The original programmer built this form with a datagrid (not datagridview).  Embedded within it are 3rd party custom cell objects so I was hoping that I could just implement my changes quickly with the existing datagrid.  My .net grid experience has only been with this datagrid I inherited.
I'll try chucking the datagrid in the garbage and replacing it with a datagridview...
SOLUTION
Avatar of Paul_Harris_Fusion
Paul_Harris_Fusion
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Paul_Harris_Fusion and Zhaolai.  That worked perfectly.  Hope you don't mind but I'll split the points.  Paul answered and Zhaolai coded it.
It's always a good idea to split points to the people who provided any help. :=)