GridView强制换行与自动换行
在PageLoad中加入如下代码:
1 //正常换行
2 GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
3 //下面这行是自动换行
4 GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
5 if (!IsPostBack)
6 {
7 bind();//调用数据绑定即可
8 }
9
2 GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
3 //下面这行是自动换行
4 GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
5 if (!IsPostBack)
6 {
7 bind();//调用数据绑定即可
8 }
9
浙公网安备 33010602011771号