1,105,456 Community Members

Transfer Data from Datagridview to Textbox

Member Avatar
Lee21
Light Poster
46 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Guyz I need help.. I'm a newbie in vb.net 2008..I have a form for User Account Maintenance and I want to transfer the Data of the specified Cell of the Datagridview once it's selected by clicking the mouse. How can I transfer it to textbox? Please help me.

Attachments User.JPG 42.75KB
Member Avatar
Oxiegen
Master Poster
765 posts since Jun 2006
Reputation Points: 88 [?]
Q&As Helped to Solve: 149 [?]
Skill Endorsements: 7 [?]
Featured
 
0
 

Guyz I need help.. I'm a newbie in vb.net 2008..I have a form for User Account Maintenance and I want to transfer the Data of the specified Cell of the Datagridview once it's selected by clicking the mouse. How can I transfer it to textbox? Please help me.

DataGridView has an event called CellClick.
You can use that to extract the value of the cell you clicked.
Ex:

Private Sub dgv_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles dgv.CellClick
        txtBox.Text = dgv.Item(e.ColumnIndex, e.RowIndex).Value.ToString
    End Sub
Member Avatar
Lee21
Light Poster
46 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanx!It was very useful.. It really help me..

DataGridView has an event called CellClick.
You can use that to extract the value of the cell you clicked.
Ex:

Private Sub dgv_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles dgv.CellClick
        txtBox.Text = dgv.Item(e.ColumnIndex, e.RowIndex).Value.ToString
    End Sub
Question Answered as of 4 Years Ago by Oxiegen
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article