asp.net gridview强制换行
asp.net gridview强制换行
发布时间:2016-12-29 来源:查字典编辑
摘要:今天遇到这个问题,网上查了下资料,这么解决:protectedvoidPage_Load(objectsender,EventArgse){...

今天遇到这个问题,网上查了下资料,这么解决:

protectedvoidPage_Load(objectsender,EventArgse)

{

//正常换行

GridView1.Attributes.Add("style","word-break:keep-all;word-wrap:normal");

//下面这行是自动换行

GridView1.Attributes.Add("style","word-break:break-all;word-wrap:break-word");

if(!IsPostBack)

{

bind();//调用数据绑定即可

}

}

如果在CSS中定义更好^-^

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新asp.net教程学习
热门asp.net教程学习
编程开发子分类