当前位置: 代码迷 >> ASP.NET >> DataGrid中有3列,其中一列很長,怎麽樣才能讓他在固定的格子中換行。解决方法
  详细解决方案

DataGrid中有3列,其中一列很長,怎麽樣才能讓他在固定的格子中換行。解决方法

热度:4721   发布时间:2013-02-26 00:00:00.0
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>
  相关解决方案