您的位置:首页 > 其它

设置GridView某个单元格显示的字数,其余的使用省略号显示

2017-02-07 16:04 225 查看
使用GridView中的 RowDataBound事件进行进行处理

 protected void GV_Content_RowDataBound(object sender, GridViewRowEventArgs e)

        {

            if (e.Row.Cells[2].Text.Length > 30)

            {

                e.Row.Cells[2].Text = e.Row.Cells[2].Text.Trim().Substring(0, 30) + "...";

            }

        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐