how to transfer data from datagrid to textbox using vb6.0????

Recommended Answers

You can use the following -

Text1.Text = Datagrid1.TextMatrix(Datagrid1.Row, 1) 'The 1 at the end refers to the coloumn value in the grid, in this case coloumn 1...
Jump to Post

Use the same code, just change the coloumn values -

Text1.Text = Datagrid1.TextMatrix(Datagrid1.Row, 1)
Text2.Text = Datagrid1.TextMatrix(Datagrid1.Row, 2)
Text3.Text = Datagrid1.TextMatrix(Datagrid1.Row, 3)
'and so on...
Jump to Post

All 6 Replies

You can use the following -

Text1.Text = Datagrid1.TextMatrix(Datagrid1.Row, 1) 'The 1 at the end refers to the coloumn value in the grid, in this case coloumn 1...

how about when you click for example the lastname then it will transfer the whole data on the datagrid to the textboxes

Use the same code, just change the coloumn values -

Text1.Text = Datagrid1.TextMatrix(Datagrid1.Row, 1)
Text2.Text = Datagrid1.TextMatrix(Datagrid1.Row, 2)
Text3.Text = Datagrid1.TextMatrix(Datagrid1.Row, 3)
'and so on...

If you want it all in one text box, the following -

Text1.Text = Datagrid1.TextMatrix(Datagrid1.Row, 1)
Text1.Text = Text1.Text & VBCRLF & Text1.Text = Datagrid1.TextMatrix(Datagrid1.Row, 2) 'and so on ...

I Want help Of vb6.
What is the code of stope watch.

Kismat, Being a new member and all I can almost understand that you do not know our posting rules, soooo, read them Here . We DO NOT allow the hijacking of other members threads.:)

How about you open your own post and I will gladly help.

Also, show me what YOU have done so far, it might make it easier for me to answer your question (THE NEW ONE) better.;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.