I've just tested this code to a messagebox and it works
So i'm guessing it will work with a richtextbox. If you need to read from everyrow in your dgv then you'll need to replace the lineVB Code:
Dim sb As New StringBuilder() Dim row As DataGridViewRow = Me.DataGridView1.Rows(0) 'Reads from the first row For Each column As DataGridViewColumn In DataGridView1.Columns sb.Append(row.Cells(column.Index).Value.ToString) sb.Append(ControlChars.NewLine) Next RichTextBox1.Text = sb.Tostring
with the codeVB Code:
Dim row as DatagridviewRow = datagridview1.rows(0)
and place it around the for loop for the columns.VB Code:
For each row as Datagridviewrow in datagridview1.rows next
Hope this helps.
________________________________________________________________________
If i've helped then please rate this post!Thanx
![]()





Reply With Quote