//GridView控件行数据绑定事件
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行 { //已设置公告内容列的宽度是200 //为公告内容列添加word-break属性 e.Row.Cells[2].Style.Add("word-break", "break-all"); } }