GridView标题行换行之我见 (转)
1、不换行:
word-break:keep-all;word-wrap:normal
2、换行:
word-break:break-all;word-wrap:break-word
以上的换行只支持英文,当标题中包含有中文时并不好用。
3、如果标题中含有中文的,只能在GridView的RowDataBound事件中添加代码,如下:
代码
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].Text = "操作用户 ";
e.Row.Cells[1].Text = "批次名称 ";
e.Row.Cells[2].Text = "文件名称 ";
e.Row.Cells[3].Text = "档案类型 ";
e.Row.Cells[4].Text = "字段名称 ";
e.Row.Cells[5].Text = "字段值 ";
e.Row.Cells[6].Text = "字段长度 ";
e.Row.Cells[7].Text = "所在流程 ";
e.Row.Cells[8].Text = "开始时间 ";
e.Row.Cells[9].Text = "结束时间 ";
e.Row.Cells[10].Text = "录入版本 ";
}
{
e.Row.Cells[0].Text = "
e.Row.Cells[1].Text = "
e.Row.Cells[2].Text = "
e.Row.Cells[3].Text = "
e.Row.Cells[4].Text = "
e.Row.Cells[5].Text = "
e.Row.Cells[6].Text = "
e.Row.Cells[7].Text = "
e.Row.Cells[8].Text = "
e.Row.Cells[9].Text = "
e.Row.Cells[10].Text = "
}
posted on 2010-02-01 17:22 小手冰凉 阅读(...) 评论(...) 编辑 收藏