P.S. I just discovered that "RowEnter" isn't the best choice either,
since when it is called, CurrentRow still reflects the previous
choice, not the new row. So, now I'm even more anxious for a good
answer to this. It's probably something trivial I'm overlooking,
but....
Thanks!
Brad.
Hi Brad,
The symbol of the completion of row navigation is the CurrentRow property
of the DataGridView is changed. Unfortunately, DataGridView doesn't provide
such a CurrentRowChanged event.
Since the CurrentRow property of the DataGridView refers the row containing
the current cell and DataGridView provides CurrentCellChanged event, we
could make use of the CurrentCellChanged event to inform of the completion
of row navigation.
Yes, you are right. When you navigate through the rows in a DataGridView,
the RowEnter and RowLeave events occur before the CurrentCellChanged event.
So these two events aren't appropriate to use in this case.
BTW, the CurrentCellChanged event will be raised when changing cells within
a row, which is not really what you want.
To solve this problem, I think you could add a variable in your program
indicating the index of the last current row. When the CurrentCellChanged
event rises, you may check whether the value of
this.DataGridView1.CurrentCell.RowIndex is equal to the value of the
variable.
If the result is Yes, don't call the code for the extra processing.
Otherwise, set the value of the variable to the lastest value of
CurrentCell.RowIndex and call the code to do extral processing.
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Bradley Plett - 05 Dec 2006 07:22 GMT
Thanks! It's not quite the answer I was looking for, but....
I'd actually resorted to using the CurrentCellChanged event already,
but as you mention, it's not perfect. Still, it will do for my
purpose for now.
Brad.
>Hi Brad,
>
[quoted text clipped - 50 lines]
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
Kevin Spencer - 05 Dec 2006 13:53 GMT
If you are using a BindingSource, you can use an event handler for the
BindingSource.PositionChanged event.

Signature
HTH,
Kevin Spencer
Microsoft MVP
Logostician
http://unclechutney.blogspot.com
There is a madness to my method.
> Thanks! It's not quite the answer I was looking for, but....
>
[quoted text clipped - 63 lines]
>>This posting is provided "AS IS" with no warranties, and confers no
>>rights.