i have a datagrid view with two columns. the first column is readonly and the other is edit开发者_开发百科able. now i want every cell of the second column to support for mulitilines in each cell. i want to press enter key and come to the next line in the same cell. im using c#.
Try replacing newlines with HTML break-tags:
var helloWorld = @"Hello
World";
// helloWorldHTML will contain "Hello<br />World";
var helloWorldHTML = helloWorld.Replace(System.Environment.NewLine, "<br />");
精彩评论