zoukankan      html  css  js  c++  java
  • GridView双击行弹出窗口

    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[7].Controls[0]);
                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[7].Controls[0]);
                
    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;');");
            }
        }

  • 相关阅读:
    layout_alignStar 与 android:layout_alignEnd
    Java学习过程中的一些知识点
    L1-054 福到了->团体程序设计天梯赛-练习集
    JS冒号的作用
    JS中(function(){xxx})(); 这种写法是什么意思?
    去除vue上方的60px空白
    vue-cli · Failed to download repo vuejs-templates/webpaack: Response code 404
    Windows 7 MBR的修复与Linux产品正确卸载
    折腾一天安装Centos7,以及后面恢复Win7引导的曲折历程
    Windows 7硬盘安装CentOS 6.4 双系统 (WIN7下硬盘安装Linux(Fedora 16,CentOS 6.2,Ubuntu 12.04))
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4177022.html
Copyright © 2011-2022 走看看