his.style.backgroundColor=color1;,color都这个值吗?  

解决方案 »

  1.   

    e.Row.Attributes.Add里面添加要执行的脚本,你那样写,html哪能识别
    color1=this.style.backgroundColor 这玩意解析不了
      

  2.   

    参考这个贴子
    http://bbs.csdn.net/topics/340261706
      

  3.   

    e.Row.Attributes.Add("onmouseout", "onmouseoutColor2(this);");
     e.Row.Attributes.Add("onmouseover", "onmouseoverColor2(this);");function onmouseoutColor2(source) {
        source.style.backgroundColor = '#F7F6F3';   
        source.style.color = 'black';
        source.style.cursor = 'default'
    }
    function onmouseoverColor2(source) {
        source.style.backgroundColor = '#F2FECD';    
        source.style.color = 'orange';           
        source.style.cursor = 'hand'
    }
    问题是一样的。鼠标没效果,背景也没效果。只有字体有效果。
      

  4.   

     
    在行绑定事件中写如下:
     if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';color1=this.style.backgroundColor;this.style.backgroundColor='#ffffcc'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=color1;this.style.cursor='default';");
            }