DataGrid on Click

adwaitjoshi

Active member
Joined
Dec 29, 2005
Messages
38
Programming Experience
1-3
I have a datagrid and I have implemented the on click as

Private Sub grdDataGrid1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles grdDataGrid1.Click

'Some code here

End Sub



now whenever I click on the datagrid the clicks are registered randomly. Not every time the code in this subroutine gets executed any idea what might be going on?


Edit : I think I got my mistake. I want to do something when a user clicks a cell and I guests the .click gets registered when I click the grid itself (like the columns headers row headers etc) how can I do what I want to do? What is the event for a on cell click?
 
Last edited:
The DataGrid SelectionChanged event can be used, since the cell is selected when you click on it. Then just work with with the cell or cells, depending
 
Back
Top