一.对于绑定的列可以用
<HeaderStyle Wrap="False" />
<ItemStyle Wrap="False" />
<HeaderStyle Wrap="False" />
<ItemStyle Wrap="False" />
特别
注意:设置单元格的宽度不起作用,
二.控制整个Gridview的换行,在RowDataBound事件中加以下语句
gvDeliverySummary.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
//gvDeliverySummary.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
三.Gridview自动生成的列隐藏方法,在RowDataBound事件中加以下语句
e.Row.Cells[1].Attributes.Add("style", "display:none");
二.控制整个Gridview的换行,在RowDataBound事件中加以下语句
gvDeliverySummary.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
//gvDeliverySummary.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
三.Gridview自动生成的列隐藏方法,在RowDataBound事件中加以下语句
e.Row.Cells[1].Attributes.Add("style", "display:none");
四.隐藏某列的单元格,
在RowDataBound事件中加以下语句
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].Attributes.Add("style", "display:none");
{
e.Row.Cells[1].Attributes.Add("style", "display:none");
}