zoukankan
html css js c++ java
手动写GridView的RowEditing RowCancelingEdit RowUpdating RowDeleting 事件 和 删除 出现提示
先定一个绑定的方法
void
Bind()
{
this
.GridViewUser.DataSource
=
new
BILL.OperateUser().SelectOneUserSqlComd();
this
.GridViewUser.DataBind();
}
protected
void
GridView1_RowEditing(
object
sender, GridViewEditEventArgs e)
{
//
索引编辑时
this
.GridViewUser.EditIndex
=
e.NewEditIndex;
Bind();
}
protected
void
GridView1_RowCancelingEdit(
object
sender, GridViewCancelEditEventArgs e)
{
//
编辑结束时
this
.GridViewUser.EditIndex
=
-
1
;
Bind();
}
protected
void
GridViewUser_RowUpdating(
object
sender, GridViewUpdateEventArgs e)
{
//
更新时
this
.GridViewUser.EditIndex
=
-
1
;
Bind();
}
GridView的AutoGenerateDeleteButton
=
"
True
"
AutoGenerateEditButton
=
"
True
"
//
删除出现提示
protected
void
GridViewUser_RowDataBound(
object
sender, GridViewRowEventArgs e)
{
//
如果是绑定数据行
if
(e.Row.RowType
==
DataControlRowType.DataRow)
{
if
(e.Row.RowState
==
DataControlRowState.Normal
||
e.Row.RowState
==
DataControlRowState.Alternate)
{
//
找到生成“删除”所在单元格
LinkButton lb
=
(LinkButton)e.Row.Cells[
0
].Controls[
2
];
lb.Attributes.Add(
"
onclick
"
,
"
javascript:return confirm('你确认要删吗?')
"
);
}
}
}
查看全文
相关阅读:
使用JAVA API 解析ORC File
spark Graph 的PregelAPI 理解和使用
流程图引擎
JMX
Spring走向注解驱动编程
java@ 注解原理与使用
Maven打包SpringBoot
Java根据实体快速生成对象
VBA基础出发
“嗝嗝老师”
原文地址:https://www.cnblogs.com/a121984376/p/1245906.html
最新文章
linux 下查看redis内存等占用量
python 操作mysql数据库之模拟购物系统登录及购物
两台linux之间建立信任关系,实现免密码ssh远程登录或scp数据上传
bash读文件的写法
history不显示行号的5种方法
MAC安装Docker Desktop
Nginx配置referer策略实现防盗链
安装Tomcat用于Jenkins持续发布
GKE logging查看
验证证书的方法和网站
热门文章
Bash cat EOF
OpenSSL创建证书
hadoop 的HDFS 的 standby namenode无法启动事故处理
kafka使用getOffsetsBefore()获取获取offset异常分析
Hive Bug修复:ORC表中array数据类型长度超过1024报异常
strom ui Topology 可视化视图各个指标含义说明
Spark技术的总结 以及同storm,Flink技术的对比
kafka各个版本特点介绍和总结
spark-mllib 密集向量和稀疏向量
【图数据结构的遍历】java实现广度优先和深度优先遍历
Copyright © 2011-2022 走看看