.NET Compact Framework Can you get grids which have multi line text in cells?

别说谁变了你拦得住时间么 提交于 2019-12-23 18:50:06

问题


Is it possible to show multiple lines of text in grid cells using the .NET Compact framework? We need to create a grid where the middle column contains an address. We'd like to show this over multiple lines and (possibly) apply some formatting to the final line.

e.g.
123 Anywhere Street
Birmingham
B1 2DU
tel: 0123 555555


回答1:


Take a look at Ilya Tumanov's example of custom formatting data in the DataGrid. He does custom painting of cells in it.




回答2:


You must override "OnPaint" method on the grid, or use some another grid ( I think the SourceGrid was in one of early version compatible wiht CF ).

.NET Framework has traditionaly not-so-good grid controls :(.




回答3:


Set AutoSizeRowsMode property in DataGridView control to DisplayedCells .

Additional info here : http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.autosizerowsmode.aspx



来源:https://stackoverflow.com/questions/126196/net-compact-framework-can-you-get-grids-which-have-multi-line-text-in-cells

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!