chargomlim
New member
- Joined
- Feb 11, 2014
- Messages
- 1
- Programming Experience
- 1-3
Good Day,
I'm a new member. I have a datagridview with multiline cell. I want to copy/paste the data in xls/csv format.
The problem is: when i paste the data in excel, i'm getting separate rows due to the multiline cells from datagrid. I want it in a single cell.
Here is my code:
Dim buffer As New StringBuilder
buffer.Append(vbCrLf)
For i As Integer = 0 to dv.Columns.Count -1
buffer.Append(dv.Columns(i).Name)
buffer.Append(vbTab)
Next
buffer.Append(vbCrLf)
For i As Integer = 0 To dv.Rows.Count -1
For j As Integer = 0 To dv.Columns.Count -1
buffer.Append(dv.Rows(i).Cells(j).Value.ToString)
buffer.Append(vbTab)
Next
buffer.Append(vbCrLf)
Next
MyComputer.ClipBoard.SetText(buffer.ToString)
I'm a new member. I have a datagridview with multiline cell. I want to copy/paste the data in xls/csv format.
The problem is: when i paste the data in excel, i'm getting separate rows due to the multiline cells from datagrid. I want it in a single cell.
Here is my code:
Dim buffer As New StringBuilder
buffer.Append(vbCrLf)
For i As Integer = 0 to dv.Columns.Count -1
buffer.Append(dv.Columns(i).Name)
buffer.Append(vbTab)
Next
buffer.Append(vbCrLf)
For i As Integer = 0 To dv.Rows.Count -1
For j As Integer = 0 To dv.Columns.Count -1
buffer.Append(dv.Rows(i).Cells(j).Value.ToString)
buffer.Append(vbTab)
Next
buffer.Append(vbCrLf)
Next
MyComputer.ClipBoard.SetText(buffer.ToString)