|
-
Aug 19th, 2012, 07:32 AM
#1
Thread Starter
Junior Member
[RESOLVED] Datagrid double click
Hello,
I searched google and the forums to try find a good tutorial or example but was not able to!
I have a form called ViewUsersGrid.vb and there is a datagridview1 in there. This uses the SQL cmd to fill the datagrid select firstname,lastname from users etc.
This then fills the grid with the information, now I want to use the datagrid doubleclick event, to double click a row to show viewuser.vb which I can do, but I want it then to fill the empty text fields with the information for that user I have double clicked on.
Thanks.
Datagridview.vb code
Code:
Dim connection As New SqlClient.SqlConnection
Dim command As New SqlClient.SqlCommand
Dim adaptor As New SqlClient.SqlDataAdapter
Dim AID As String = AgentIDNum.AgentIDNumber
Dim dataset As New DataSet
connection.ConnectionString = "Data Source=ANDY-PC\LETTINGS;Initial Catalog=easylet_database;User Id=sa;Password=g3m1n1;"
command.CommandText = "Select Title, FirstName, LastName, Telephone, Telephone2, Email from Users"
connection.Open()
command.Connection = connection
adaptor.SelectCommand = command
adaptor.Fill(dataset, "MyTable")
DataGridView1.DataSource = dataset.Tables("MyTable").DefaultView
I also have a save button in the viewusers form, so once its loaded into the new form I want to say change the password and click save and its save it.
cheers.
-
Aug 19th, 2012, 07:39 AM
#2
Re: Datagrid double click
Follow the CodeBank link in my signature and check out my thread on Editing A Grid Row In A Dialogue.
-
Aug 19th, 2012, 07:40 AM
#3
Thread Starter
Junior Member
Re: Datagrid double click
Cant see that thread vb.net code bank?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|