protected void GridViewEx1_RowDataBound(object sender, GridViewRowEventArgs e)
   {
       if (e.Row.RowType == DataControlRowType.DataRow)//判断单击行是否为数据行  
         {  
              DataRowView row = (DataRowView)e.Row.DataItem;  
              e.Row.ID = GridViewEx1.DataKeys[e.Row.RowIndex]["ID"].ToString();//ID为唯一能够标识一条记录的字段  
              if (e.Row.ID != null && row != null)  
              {  
                 e.Row.Cells[1].Attributes.Add("ondblclick", "window.open('ParhelionRestEdittPage.aspx?index=" + (e.Row.RowIndex + 1).ToString() + "&);

                 e.Row.Cells[1].Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F89E14',this.style.cursor='pointer';");  
                  //鼠标事件 this.style.backgroundColor='#F89E14' 列背景色  this.style.cursor='pointer' 鼠标放上去样式  
                 e.Row.Cells[1].Attributes.Add("onmouseout", "this.style.backgroundColor='';");  
              }  
           }  
        }
    }

  

相关文章:

  • 2021-12-12
  • 2021-10-13
  • 2022-01-07
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
  • 2021-12-12
  • 2022-01-02
  • 2021-12-15
相关资源
相似解决方案