Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a from with one datagrid and one textbox, i want put multiple value to textbox on mouse click in row of datagrid
Posted
Comments
Karen Mitchelle 21-Jan-14 3:27am    
you mean, you want to display all the data from your datagridview (which has only one column and multiple rows) to only one textbox?
How do you plan to display it? There must be a concatenation or something.

1 solution

You could do it like this
VB
Dim s As String = ""
For Each x As DataGridViewRow In Me.DataGridView1.Rows
    s += x.Cells(0).Value + Environment.NewLine
Next
Me.TextBox1.Text = s

Note that TextBox1 has Multiline set to true - if not using multiline then remove the + Environment.NewLine
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900