http://www.cnblogs.com/Far/archive/2008/05/15/1197557.html这里你能找到答案

解决方案 »

  1.   

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            int i;
            //执行循环,保证每条数据都可以更新
            for (i = 0; i < GridView1.Rows.Count; i++)
            {
                //首先判断是否是数据行
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    //当鼠标停留时更改背景色
                    e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF'");
                    //当鼠标移开时还原背景色
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
                }
            }    }
    你变通一下就得到了
      

  2.   

    GridView里边不是有个选择吗
    另外http://www.cnblogs.com/Far/archive/2008/05/15/1197557.html ,这个里边你可以看下,可以让鼠标经过变色
      

  3.   


    //单击行改变行背景颜色
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onclick", "this.style.backgroundColor='#99cc00'; this.style.color='buttontext';this.style.cursor='default';");
            }
      

  4.   

    <script type="text/javascript">
        var oldRow;
        function ChangeColor(row)
        {
          if(oldRow != undefined)
          {
            oldRow.style.backgroundColor="#FFFFFF";
          }
          oldRow = row;
          row.style.backgroundColor="#7788CC";
        }
    </script>
    <asp:TemplateField>
          <ItemTemplate>
               <a href="#" onclick="ChangeColor(this.parentNode.parentNode)">ChangeColor</a>
          </ItemTemplate>
    </asp:TemplateField>没必要使用服务器控件LinkButton,直接使用超级连接即可,因为是在客户端该变颜色。