protected void gvCustom_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#ccddee'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
//设置悬浮鼠标指针形状为"小手"
e.Row.Attributes["style"] = "Cursor:hand"; ImageButton imgFlag = new ImageButton();
imgFlag = ((ImageButton)e.Row.Cells[].Controls[]);
if (imgFlag.AlternateText == "删除")
{
imgFlag.Attributes.Add("onclick", "javascript:return confirm('您确信要删除:/"" +e.Row.Cells[1].Text+"/" 吗?')"); //Button btn = (Button)e.Row.Cells[5].Controls[0];
//btn.Attributes.Add("onclick", "javascript:return confirm('你确认要删除:/"" + e.Row.Cells[1].Text + "/"吗?')"); //Button1.Attributes.Add("onclick","return confirm(’确认?’)");
//button.attributes.add("onclick","if(confirm(’are you sure?’)){return true;}else{return false;}")
}
//设置弹出窗体
//string CustomID= gvCustom.DataKeys[ e.Row.RowIndex]["CustomID"].ToString() ;
//e.Row.Attributes.Add("ondblclick", "javascript:window.showModalDialog('./CustomInfo.aspx?CustomID=" + CustomID + "',window,'scroll:no;status:no;center:yes;dialogHeight:480px;dialogWidth:700px;');");
}
}

protected void gvCustom_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#ccddee'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
            //设置悬浮鼠标指针形状为"小手"   
            e.Row.Attributes["style"] = "Cursor:hand";

ImageButton imgFlag = new ImageButton();
            imgFlag = ((ImageButton)e.Row.Cells[].Controls[]);
            if (imgFlag.AlternateText == "删除")
            {
                imgFlag.Attributes.Add("onclick", "javascript:return confirm('您确信要删除:/"" +e.Row.Cells[1].Text+"/" 吗?')");

//Button btn = (Button)e.Row.Cells[5].Controls[0];
                //btn.Attributes.Add("onclick", "javascript:return confirm('你确认要删除:/"" + e.Row.Cells[1].Text + "/"吗?')");

//Button1.Attributes.Add("onclick","return confirm(’确认?’)");
                //button.attributes.add("onclick","if(confirm(’are you sure?’)){return true;}else{return false;}") 
            }
            //设置弹出窗体
            //string CustomID= gvCustom.DataKeys[ e.Row.RowIndex]["CustomID"].ToString() ;
            //e.Row.Attributes.Add("ondblclick", "javascript:window.showModalDialog('./CustomInfo.aspx?CustomID=" + CustomID + "',window,'scroll:no;status:no;center:yes;dialogHeight:480px;dialogWidth:700px;');");
        }
    }

最新文章

  1. tomcat8和7关于自定义tag的处理区别
  2. 实现iOS图片等资源文件的热更新化(四): 一个最小化的补丁更新逻辑
  3. AlwaysOn可用性组测试环境安装与配置(一)--SQL群集环境搭建
  4. 【RQNOJ356】myt的格斗
  5. ReSharper 配置及用法(二)
  6. php友好格式化时间
  7. 地球坐标系与投影方式的理解(关于北京54,西安80,WGS84;高斯,兰勃特,墨卡托投影)
  8. 如何在tomcat安装部署php项目
  9. 剑指Offer:找出数组中出现次数超过一半的元素
  10. Mybatis mapper文件中的转义方法
  11. SqlServer 行转列,列转行 以及PIVOT函数快速实现行转列,UNPIVOT实现列转行
  12. linux图形化客户端
  13. computational biology | Bioinformatician | 开发者指南
  14. 2.4 CSS定位
  15. pycahrm 基础设置
  16. Jmeter响应中中文乱码解决办法
  17. Web API 源码剖析之默认消息处理程序链之路由分发器(HttpRoutingDispatcher)
  18. maven下@override标签失效
  19. python上安装requests
  20. redis live 如何安装

热门文章

  1. Numpy学习50例
  2. Linux终端复用工具 tmux
  3. Java之集合(十九)LinkedBlockingDeque
  4. 原生js动态添加style,添加样式
  5. 笛卡尔积算法的sku
  6. 共识算法:Paxos
  7. XML CData 处理
  8. 面试:TCP和UDP协议
  9. clientX/Y pageX/Y offsetX/Y layerX/Y screenX/Y clientHeight innerWidth...
  10. CSS3完善和模式