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

  • 相关阅读:
    Linux之流程判断
    Linux之Shell变量
    Linux之RAID
    Y-Sport
    [ST2017] Lab1: Triangle type and Junit test
    [ST2017] Hw3: Prime Path
    [ST2017] Hw2: Fault, Error, Failure and test case for projects
    [SPM2017] Hw1: The outcome of my project [Deadline: 23:59:59, Mar.1, 2017]
    [ST2017] Hw1: An error from my past projects [Deadline: 23:59:59, Feb.27, 2017]
    一个使用Jmeter做接口性能测试的实战案例
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4177022.html
Copyright © 2011-2022 走看看