By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,264 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,264 IT Pros & Developers. It's quick & easy.

datagrid event

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <ro*****@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
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

Nov 21 '05 #2

P: n/a
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

"rodchar" wrote:
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

Nov 21 '05 #3

P: n/a
thank you. this helps.

"vvenk" wrote:
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

"rodchar" wrote:
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

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.