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;');");
            }
        }

  • 相关阅读:
    Ant简单工程的构建
    [转载] 无所不能的“蚂蚁”--Ant
    引体向上高级技巧:停顿式引体向上!
    引体向上腰酸?下背痛?你做对了吗?
    划船训练常见错误:含胸驼背肩胛骨活动不足
    引体向上
    仰卧飞鸟:仰卧哑铃飞鸟图解教程
    蝶机夹胸:蝴蝶机夹胸夹胸/飞鸟动作图解教程
    史密斯卧推:杠铃史密斯下斜卧推、上斜机卧推、平板卧推动作图解
    练胸秘籍:胸肌训练5大重点
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4177022.html
Copyright © 2011-2022 走看看