We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,703 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Select row and show each attribute in certain textbox field

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
2
Contributors
2
Replies
42 Minutes
Discussion Span
5 Months Ago
Last Updated
3
Views
laogao99
Newbie Poster
1 post since Dec 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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

khair.ullah
Junior Poster in Training
55 posts since Aug 2012
Reputation Points: -2
Solved Threads: 3
Skill Endorsements: 0

Some coding mistake

TextBox3 instead of fextbox3

khair.ullah
Junior Poster in Training
55 posts since Aug 2012
Reputation Points: -2
Solved Threads: 3
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0581 seconds using 2.66MB