首页
VS Code教程
(current)
VS Code插件
(current)
VS Code打造IDE
(current)
VScode更新日志
(current)
关于
asp.net获得数据控件事件索引并获取其中值总结
348
人浏览 /
0
人评论
复制代码
代码如下:
1、RowCommad
//获得索引
int index = ((GridViewRow)(((Button)(e.CommandSource)).Parent.Parent)).RowIndex;
2、RowEditing等
//获得索引
int index = e.NewEditIndex;
//获取当前GridViewRow对象
GridViewRow editGridViewRow = autoGridView.Rows[girdviewEditIndex];
//获取内容方法一 row中有控件Label
Label girdviewTitleLabel = editGridViewRow.Cells[0].FindControl("titleLabel") as Label;
string gridViewContent = girdviewTitleLabel.Text;
//获取内容方法二 row中有无控件Label
//string gridViewContent = editGridViewRow.Cells[0].Text;
3、RowDeleting等
//获得索引
int index=e.RowIndex ;
//获取当前GridViewRow对象
GridViewRow gvr=autoGridView.Rows[index];
//取得当前行第二个单元格中的文字
string str = gvr.Cells[1].Text;
您可能感兴趣的文章:
asp.net连接数据库读取数据示例分享
asp.net 通用的连接数据库实例代码
asp.net连接数据库 增加,修改,删除,查询代码
ASP.Net Post方式获取数据流的一种简单写法
ASP.NET中操作SQL数据库(连接字符串的配置及获取)
asp.net获取SQL所有数据库名、所有表名、所有字段名
ASP.NET连接数据库并获取数据方法总结
相关文章
如何有效避免设计作品“空”?
高点击率钻展,设计环节…
无敌配色技巧(一)
留言
全部评论
晴天下起了小雨
2017-10-01 18:00
很喜欢,果断关注了
回复
wjmyly7336064
2017-10-01 18:00
相当实用,赞美了
橘大佬
2017-10-01 18:00
就是有些细节再到位点就好了…
回复
微信公众号
关注微信公众号获取更多VSCode编程信息,定时发布干货文章
最新文章
What's the make money?
MySQL 9.0 的新增功能
Apple 在 iOS 17 中使用 Swift 和 SwiftUI
编写更多“无用”软件
windows 修改环境变量后在 vscode 的终端不生效的两种解决方法
整理列出PHP各个版本5.2至8.0、8.1的特性以及区别
unicode 表情对照表
Stable Diffusion(AI绘画)Lora模型BRA V4发布:AI生成东亚人照片的生态可能因此改变
热门标签
VSCode
python
php
插件
防火墙
nodejs
远程开发
linux
virtualenv
flutter
安卓
苹果
图标主题
mysql
VScode插件
全部评论