Dear John
As far as I know the characters '\r\n' really could display as new line.
You may try:
dataTable.Columns.Add("WrapColumn", typeof(string), "[c1]+\'\r\n\'+[c2]");
Make sure you type "[c1]+\'\r\n\'+[c2]" in the express property of Column.
@"[c1]+'\r\n\'+[c2]" is not correct, due to @-quoting is that escape
sequences are not processed.
In Addition, by default, text in a DataGridViewTextBoxCell does not wrap.
new line characters in the text do not apply and so they are displayed as a
"non-printable" character.
If you want to display such characters in DataGridView, you may controll
WrapMode property on the cell style.
this.dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
Hope this helps. Please let me know if you meet any futher issue or have
anything unclear. I'm glad to assist you. Have a great day. Thanks.
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.