1.11M Members

Transfer Data from Datagridview to Textbox

 
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
 
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
 
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