如题?谢谢!!! 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");
}
}我试过用换行符, 以及 都没有效果,不知道为什么啊?
{
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");
}
}我试过用换行符, 以及 都没有效果,不知道为什么啊?
后面的大写一,写一个转换方法.
http://www.cnblogs.com/jinglecat/archive/2006/11/21/566780.html[code=INIFile]如果需要对WebControl设置title(其实是tooltip属性)这两种方法都失效了,
而是只需要插入编程语言内置的换行符,比如C# 插入 \n[/code]
使用div模拟title
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");
}
}
圣诞快乐!
2、这是第二行、
3、这是第三行";这样这可以了 \r也应该可以
停留时间不能控制,可以用div模拟