Created
December 12, 2013 00:42
-
-
Save ferlyz05/7921326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Specific Cell Contents to string - (row 0, cell 0) | |
Dim s As String = Me.DataGridView1.Rows(0).Cells(0).Value | |
' Selected Cell | |
Dim s As String = Me.DataGridView1.SelectedCells(0).Value | |
' A single string containing all selected cell values | |
Dim s As String = "" | |
For Each c As DataGridViewCell In Me.DataGridView1.SelectedCells | |
s = s & c.Value & Environment.NewLine | |
Next | |
' A single string for all Cells in a datagridview | |
Dim s As String = "" | |
For Each r As DataGridViewRow In Me.DataGridView1.Rows | |
For Each c As DataGridViewCell In r.Cells | |
s = s & c.Value & "," | |
Next | |
s = s & Environment.NewLine | |
Next | |
MsgBox(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment