1,105,263 Community Members

Select row and show each attribute in certain textbox field

laogao99
Newbie Poster
1 post since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

i want to click on a row in grid view and the details of each attribute can show separately in textbox field.
i had type this in my coding part, but it doesnt work. may i know how to do it?
thanks you.

 Dim text As New TextBox

        Dim sql_productname As String = " select Product_name from Product_detail where Product_name = """ & grid_bed(nowrow, 0).Value & """"

        txt_name.Text = sql_productname
Member Avatar
khair.ullah
Junior Poster in Training
72 posts since Aug 2012
Reputation Points: -2 [?]
Q&As Helped to Solve: 6 [?]
Skill Endorsements: 0 [?]
 
0
 

Select your gridview and go to property and then Event & then select MouseClick event and Double click . Then add the follwing Code

Dim i As
Integer
i =
DataGridView1.
CurrentRow.Index
textbox1.Text
= DataGridView1.
Item(0, i).Value
TextBox2.
Text =
DataGridView1.
Item(1, i).Value
fextBox3.
Text =
DataGridView1.
Item(2, i).Value
textbox3.
Text =
DataGridView1.
Item(3, i).Value

Member Avatar
khair.ullah
Junior Poster in Training
72 posts since Aug 2012
Reputation Points: -2 [?]
Q&As Helped to Solve: 6 [?]
Skill Endorsements: 0 [?]
 
0
 

Some coding mistake

TextBox3 instead of fextbox3

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: