Thanks for your reply. I'm posting my code where I've tried the first suggestion you made. Although I don't get an error, it seems to replace the spaces in the string with other symbols (screenshot attached). My goal is to have the value displayed like this:
1000
2000
3000
4000
within a single cell. This is a single string where the numbers are separated by spaces.
I want to avoid the display looking like - 1000 2000 3000 4000. In other words, I want the text to appear stacked.
Any suggestions are appreciated.
Private Sub dgvRecords_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgvRecords.CellFormatting
If e.ColumnIndex = 3 Then
Dim strValue As String = TryCast(e.Value, String)
If strValue Is Nothing Then Return
strValue = CStr(dgvRecords.Item(e.ColumnIndex, e.RowIndex).Value)
Dim strArray As String = strValue.Replace(" ", Environment.NewLine)
e.Value = strArray
End If
End Sub