惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
C
CXSECURITY Database RSS Feed - CXSecurity.com
NISL@THU
NISL@THU
S
Schneier on Security
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Tenable Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google Online Security Blog
Google Online Security Blog
GbyAI
GbyAI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
Forbes - Security
Forbes - Security
博客园 - 叶小钗
量子位
I
Intezer
腾讯CDC
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
F
Fortinet All Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
Jina AI
Jina AI
Project Zero
Project Zero
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
Latest news
Latest news
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
Spread Privacy
Spread Privacy
M
MIT News - Artificial intelligence
F
Full Disclosure
P
Proofpoint News Feed
B
Blog
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
AWS News Blog
AWS News Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 聂微东
小众软件
小众软件
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives

博客园 - javaca88

SQL高级语法汇总 textaera maxlength - javaca88 - 博客园 聚焦索引与非聚焦索引及其查询效率 zhuan - javaca88 - 博客园 博文阅读密码验证 - 博客园 FormView1.ChangeMode 最经典的实现字符数控制的方案哦!(完善版)(转) JavaScript实际应用:父子页面交互 FormView1 动态传参数 如何取得treeview的节点的checkbox的value值 - javaca88 - 博客园 DetailsView1 动态添加自动列 - javaca88 - 博客园 要用到的代码2 - javaca88 - 博客园 技术网站收录 step by step 7 转:C#.Net的常见面试试题 zuo ye 缓冲池 Assembly.Load 获取硬盘序列号 split 正确用法 在SQLSERVER里写了一个Split函数
grid view控件中经常会遇到选择行的问题,怎么才能获得当前行呢
javaca88 · 2006-10-24 · via 博客园 - javaca88

 在grid view控件中经常会遇到选择行的问题,怎么才能获得当前行呢?以下为该问题的解决方法:

protected void Button1_Click1(object sender, EventArgs e)
    {
        
        Button bt=(Button)sender;
        DataControlFieldCell dv=(DataControlFieldCell)bt.Parent;
        GridViewRow gvr=(GridViewRow)dv.Parent;
        index = gvr.RowIndex;
    }

Button1为girdview中的一个按钮空间,DataControlFieldCell dv为该控件所属的单元格,bt.Parent为获得他的父空间,  GridViewRow gvr=(GridViewRow)dv.Parent 获得所在行,  index = gvr.RowIndex取得行索引。

posted on 2006-10-24 14:01  javaca88  阅读(396)  评论(0)    收藏  举报