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