双击GRIDVIEW某行,该行记录字体加粗,再次双击,则回复原样,
请问这种效果应该如何实现?

解决方案 »

  1.   


    protected void gvLogInfo_RowDataBound(object sender, GridViewRowEventArgs e)
    {
       if(e.Row.RowType == DataControlRowType.DataRow)
       {
           e.Row.Attributes.Add("click","this.style.字体变粗");
       }
    }
      

  2.   

    加上这个 cs:protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
            {
                if (e.Row.RowType == DataControlRowType.DataRow) 
                {
                    e.Row.Attributes.Add("ondblclick","chu(this)");
                   
                }
            }
    还要加段注册的chu(this)的js:
    <script type="text/javascript">
             function chu(obj) {
                 if (obj.className == null || obj.className == "") {
                     obj.className = "cs";
                 } else {
                 obj.className = "";
                  }
             }
        </script>
      

  3.   


    看看我上面的回答 还要定义一个cs的样式:
    <style type="text/css">
            .cs
            {
                font-weight: bolder;
                font-size: 20px;
            }
            
        </style>
      

  4.   


    $("table tr").dblclick(functin () {     
        //双击事件的执行代码
        var self = $(this);
        self.hasClass("BoldClass") ? self.removeClass("BoldClass") : self.addClass("BoldClass");    
    });