如题?谢谢!!!    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
    {
                if (e.Row.RowType == DataControlRowType.DataRow) 
        {
            this.GridView1.Attributes.Add("bordercolor", "#6B696B"); 
            e.Row.Attributes["onclick"] = String.Format("javascirpt:__doPostBack('GridView1','Select$" + e.Row.RowIndex + "')");
            e.Row.Attributes["style"] = "Cursor:hand";
            e.Row.Attributes["title"] =  "1、这是第一行;2、这是第二行、3、这是第三行";
            e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F1F1F1'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
    }
    }我试过用换行符,
以及
 都没有效果,不知道为什么啊?

解决方案 »

  1.   

    e.Row.Attributes["title"] =  e.RowIndex.ToString() + "、这是第一行;"
    后面的大写一,写一个转换方法.
      

  2.   

    ASP.NET Tricks&Tip:关于Tooltip(title)的换行问题 
    http://www.cnblogs.com/jinglecat/archive/2006/11/21/566780.html[code=INIFile]如果需要对WebControl设置title(其实是tooltip属性)这两种方法都失效了,
    而是只需要插入编程语言内置的换行符,比如C# 插入 \n[/code]
      

  3.   

          e.Row.Attributes["title"] = "1、这是第一行;\n2、这是第二行、\n3、这是第三行"; 
      

  4.   

    加什么都不行
    使用div模拟title
      

  5.   

    Tooltip里面好像是不能换行的吧
      

  6.   


        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
        { 
                    if (e.Row.RowType == DataControlRowType.DataRow) 
            { 
                this.GridView1.Attributes.Add("bordercolor", "#6B696B"); 
                e.Row.Attributes["onclick"] = String.Format("javascirpt:__doPostBack('GridView1','Select$" + e.Row.RowIndex + "')"); 
                e.Row.Attributes["style"] = "Cursor:hand"; 
                e.Row.Attributes["title"] =  @"1、这是第一行;
    2、这是第二行、
    3、这是第三行"; 
                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F1F1F1'"); 
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c"); 
        } 
        } 
    圣诞快乐!
      

  7.   

    顺便再问一下:title停留的时间能否自定义长短?
      

  8.   

                e.Row.Attributes["title"] =  @"1、这是第一行;
    2、这是第二行、
    3、这是第三行";这样这可以了 \r也应该可以
    停留时间不能控制,可以用div模拟