在RowCreated事件中添加
e.Row.Cells[6].Attributes.Add("style", "word-break :break-all ; word-wrap:break-word");

这样则会让你选定的列自动换行了 不过前提是要给列设置宽度
<asp:BoundField DataField="Memo" HeaderText="备注" >
<ItemStyle Width="20%" Wrap="True" />
</asp:BoundField>
前台这样写。 注意: Wrap="True" 啊!

上面只能对单一的列其作用。

下面是全局的,写到CSS里最好不过了。
GridView.Attributes.Add( "style ", "table-layout:fixed ")

相关文章:

  • 2021-12-21
  • 2022-01-30
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2021-09-08
猜你喜欢
  • 2022-12-23
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
相关资源
相似解决方案