GridView标题行换行之我见 (转)
生活随笔
收集整理的這篇文章主要介紹了
GridView标题行换行之我见 (转)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
GridView標題行換行之我見 (轉)
{
????e.Row.Cells[0].Text?=?"<nobr>操作用戶</nobr>";
????????????e.Row.Cells[1].Text?=?"<nobr>批次名稱</nobr>";
????????????e.Row.Cells[2].Text?=?"<nobr>文件名稱</nobr>";
????????????e.Row.Cells[3].Text?=?"<nobr>檔案類型</nobr>";
????????????e.Row.Cells[4].Text?=?"<nobr>字段名稱</nobr>";
????????????e.Row.Cells[5].Text?=?"<nobr>字段值</nobr>";
????????????e.Row.Cells[6].Text?=?"<nobr>字段長度</nobr>";
????????????e.Row.Cells[7].Text?=?"<nobr>所在流程</nobr>";
????????????e.Row.Cells[8].Text?=?"<nobr>開始時間</nobr>";
????????????e.Row.Cells[9].Text?=?"<nobr>結束時間</nobr>";
????????????e.Row.Cells[10].Text?=?"<nobr>錄入版本</nobr>";????????????
}???????
1、不換行:
word-break:keep-all;word-wrap:normal
2、換行:
word-break:break-all;word-wrap:break-word
以上的換行只支持英文,當標題中包含有中文時并不好用。
3、如果標題中含有中文的,只能在GridView的RowDataBound事件中添加代碼,如下:
{
????e.Row.Cells[0].Text?=?"<nobr>操作用戶</nobr>";
????????????e.Row.Cells[1].Text?=?"<nobr>批次名稱</nobr>";
????????????e.Row.Cells[2].Text?=?"<nobr>文件名稱</nobr>";
????????????e.Row.Cells[3].Text?=?"<nobr>檔案類型</nobr>";
????????????e.Row.Cells[4].Text?=?"<nobr>字段名稱</nobr>";
????????????e.Row.Cells[5].Text?=?"<nobr>字段值</nobr>";
????????????e.Row.Cells[6].Text?=?"<nobr>字段長度</nobr>";
????????????e.Row.Cells[7].Text?=?"<nobr>所在流程</nobr>";
????????????e.Row.Cells[8].Text?=?"<nobr>開始時間</nobr>";
????????????e.Row.Cells[9].Text?=?"<nobr>結束時間</nobr>";
????????????e.Row.Cells[10].Text?=?"<nobr>錄入版本</nobr>";????????????
}???????
?
?
posted on 2010-02-01 17:22 小手冰涼 閱讀(...) 評論(...) ?編輯 收藏轉載于:https://www.cnblogs.com/gonghui/articles/1661198.html
總結
以上是生活随笔為你收集整理的GridView标题行换行之我见 (转)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 初三学生成绩跟不上,福州有没有哪所学校可
- 下一篇: 判断页面元素存在与否