zoukankan      html  css  js  c++  java
  • GridView1_RowDataBound解决限制字段显示长度用"..."显示ToolTip

    ToolTip:

    //
    // 摘要:
    // 获取或设置当鼠标指针悬停在 Web 服务器控件上时显示的文本。
    //
    // 返回结果:
    // 当鼠标指针悬停在 Web 服务器控件上时显示的文本。默认值为 System.String.Empty。

    protected void gvMain_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string url = e.Row.Cells[5].Text.Trim();
                    if (url.length>20)
                    {
                        e.Row.Cells[5].ToolTip = url;
                        e.Row.Cells[5].Text = url.substring(0,20)+"...";
                    }
             }
            
        }

  • 相关阅读:
    函数
    关联子查询
    子查询
    视图(VIEW)
    顺时针打印矩阵
    二叉树的镜像
    树的子结构
    将两个有序链表合并
    反转链表
    输出链表中倒数第k个结点
  • 原文地址:https://www.cnblogs.com/liouxing199/p/5264995.html
Copyright © 2011-2022 走看看