How do I create a mouse click event on a datagrid?

  • Thread starter Thread starter Mac via DotNetMonster.com
  • Start date Start date
M

Mac via DotNetMonster.com

Hi all,

I am new to VB.NET and what to activate some code when I double click on a
particular row in a datagrid.

Can you anyone tell me what event handle I need to use? Some sample code
would be appreciated.


regards,

Mac
 
Typical - as soon as I post I find it how to do it in the on-line help :)

This is the code I added:

Private Sub sdg_details_dbl_click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles sdg_details.DoubleClick
' Add event handler code here.
MsgBox("I have double cliked on datagrid", MsgBoxStyle.Information,
"Message Box")
End Sub

But it only works when I dbl-click on the blank whitespace on the datagrid
or on the current row indicator column. Is it possible to have a double
click event on an actual cell? I have set my datagrid to read-only.

Mac
 
Back
Top