开发者

cell of a datagridview to support multiple lines using c#

开发者 https://www.devze.com 2022-12-25 05:49 出处:网络
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 wa

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 />");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号