zoukankan      html  css  js  c++  java
  • GridView移动行变色

    1.
            protected void myGridView_RowDataBound(object sender, GridViewRowEventArgs e)
            
    {
                
    //if (e.Row.RowType == DataControlRowType.Header)
                
    //{
                
    //    e.Row.Attributes.Add("style", "background-image:url('./HeadImages/headeImage.jpg')");
                
    //}
                if (e.Row.RowType == DataControlRowType.DataRow)
                
    {
                    
    //e.Row.Attributes["onmouseover"] = "ItemOver(this)";
                    e.Row.Attributes.Add("onmouseover""e=this.style.backgroundColor; this.style.backgroundColor='#EEEEEE'");
                    e.Row.Attributes.Add(
    "onmouseout""this.style.backgroundColor=e");
                }

            }

    2.
    e.Row.Attributes["onmouseover"= "ItemOver(this)";
    if (!objbeforeItem)
    {
        
    var objbeforeItem=null;
        
    var objbeforeItembackgroundColor=null;
    }
        
    function ItemOver(obj)
    {
        
    if(objbeforeItem)
        
    {
            objbeforeItem.style.backgroundColor 
    = objbeforeItembackgroundColor;
        }

        objbeforeItembackgroundColor 
    = obj.style.backgroundColor;
        objbeforeItem 
    = obj;
        obj.style.backgroundColor 
    = "#B9D1F3";     
    }
  • 相关阅读:
    学习c++一点一滴mbstowcs
    学习c++一点一滴读取网络适配器信息
    学习c++一点一滴资源dll的封装和调用
    存储过程
    学习c++一点一滴c++builder 导出excel
    线程池
    Jacob操作office文档(Word,PPT,Excel)
    域名转让
    线程交互
    Scala中的语言特性是如何实现的(2)
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/1242230.html
Copyright © 2011-2022 走看看