DataGridView CellContentClick event handler not being invoked
Hello,
There is something strange going on in my VB 2005 program that I don't understand...
I have a form that has several tab pages. Each page has one or more DataGridView controls.
When a user selects an item on one DataGridView , I want to deselect anything currently selected on any other DataGridView on that tab page. The only thing that should then be selected is the item I clicked on in the current DataGridView .
I created the following code (note there is a CellContentClick handler for each DataGridView control and there are DeselectAll... and RefreshAll... subroutines for each tab page).
It's fairly straightforward. But notice where I placed the XXX NOTE comment below. If I place a breakpoint there, run the program and click on various cells in various grids, and then click on the specified grid cell, I can create situations where the breakpoint is never reached! Thus, I don't turn off the selection in other grids.
How can this be? Is there some setting for DataGridView controls that I've inadvertently set incorrectly (without my listing them all here)? Or is there some bug in VB I'm unaware of? The "DeselectAll" subroutine merely iterates over all DataGridView controls in the current tab page (except for the current DataGridView) and calls ClearSelection on each such grid. RefreshAll calls Refresh on every DataGridView on the current tab page.
Thanks!
'========================================PrivateSub gridEmergencyDiagnosticEvents_CellContentClick(ByVal senderAs System.Object,ByVal eAs System.Windows.Forms.DataGridViewCellEventArgs)Handles gridEmergencyDiagnosticEvents.CellContentClickDeselectAllEmergencyGrids(gridEmergencyDiagnosticEvents) ' XXX NOTE - I put a breakpoint here! XXX
RefreshAllEmergencyGrids()
EndSub
