日期:2014-05-17 浏览次数:20457 次
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699ff'");
e.Row.Attributes.Add("onmouseout", "this.style.backrgoundColor=currentcolor;");
//e.Row.Cells[3].Text = (Convert.ToSingle(e.Row.Cells[3].Text)).ToString("F2");
//e.Row.Cells[3].Text = string.Format("{0:F2}", Convert.ToDouble(e.Row.Cells[3].Text));
}
e.Row.Attributes["onmouseover"] = "e=this.style.backgroundColor;this.style.backgroundColor='#6699ff'"; e.Row.Attributes["onmouseout"] = "this.style.backgroundColor=e";
------解决方案--------------------
refer:
http://www.cnblogs.com/insus/articles/1411057.html
http://www.cnblogs.com/insus/archive/2011/06/25/2090071.html
http://www.cnblogs.com/insus/archive/2011/10/17/2215637.html