datagrid event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,

i have a win form that has a datagrid on it and i was wondering if i can use
a double-click event to pull up the next form to show details?

thanks,
rodchar
 
You can. You override the doubleclick event for the datagrid. You then
need to do DataGrid.HitTest() to make sure it is in a cell. If it is in a
cell then use the currentrowindex to find out what row you need to go into
detail on. Hope that helps.

Chris
 
Rodchar:

Of course you can. Except you cannot trap a double-click but rather a single
click:

Private Sub DataGrid1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseUp
If e.Button = MouseButtons.Left Then
'Open your form!
End If
End Sub

Hope it helps.

Venkat
 
thank you. this helps.

vvenk said:
Rodchar:

Of course you can. Except you cannot trap a double-click but rather a single
click:

Private Sub DataGrid1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseUp
If e.Button = MouseButtons.Left Then
'Open your form!
End If
End Sub

Hope it helps.

Venkat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

residual of some sort 1
Datagrid deleting rows 2
msdn.vb.lang forum grid 10
datagrid new row 3
master/details 5
is this a collection or not. 6
An array and a datagrid 9
Are these too many? 2

Back
Top