日期:2014-05-20  浏览次数:20441 次

DataGrid中有3列,其中一列很長,怎麽樣才能讓他在固定的格子中換行。
DataGrid中有3列,其中一列很長,怎麽樣才能讓他在固定的格子中換行。
有點類似ASP中的NOWRAP的功能。
在綫等

------解决方案--------------------
设置一下列宽就可以了~~~~
------解决方案--------------------
e.Item.Cells[1].Style.Add( "width ", "100px "); e.Item.Cells[1].Style.Add( "word-wrap ", "break-word "); 仅ie下有效。
------解决方案--------------------
设置列宽,在aspx页面中:
<asp:BoundColumn DataField= "coname " HeaderText= "企业名称 " ItemStyle-Width= "10% "> </asp:BoundColumn>