roarteam
asked on
OPening a form and passing data from datagrid in VB.NET
I have a form (frmMain) with a datagrid (dgCustomerMain). I also created a contextmenu (contextCustomers) with a selection of "View Customer Detail". I would like to right click on a record to show the context menu, select the "View Customer Detail" item and then open up an existing form (frmCustomerDetail) to that particular record for editing. I have searched and tried similar posts, but they are either in C or only create a msgbox.
Currently, I have the right click code working:
Private Sub dgCustomerMain_MouseUp(ByV al sender As Object, ByVal e As System.Windows.Forms.Mouse EventArgs) Handles dgCustomerMain.MouseUp
If e.Button = Windows.Forms.MouseButtons .Right Then
End If
End Sub
Now I just need the code to display the context and open the form to the correct record.
Currently, I have the right click code working:
Private Sub dgCustomerMain_MouseUp(ByV
If e.Button = Windows.Forms.MouseButtons
End If
End Sub
Now I just need the code to display the context and open the form to the correct record.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
In the form load:
Open in new window
That selects the entire row anytime a cell is clickedTo pick which row to select:
Open in new window
To open the form and pass a value
Open in new window
And in the form being opened...
Open in new window
The find is not working, but I'll leave that to another post.