在复选框检查已更改的事件上获取转发器内gridview的rowindex [英] Get the rowindex of gridview inside repeater on checkbox checked changed event

查看:67
本文介绍了在复选框检查已更改的事件上获取转发器内gridview的rowindex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在转发器控件项目模板中有一个gridview.Gridview有一个复选框字段。选中已复选的复选框事件我需要gridin的rowindex。基于这个rowindex我想从数据库中获取数据并在表单上显示。 />
如何获取网格的rowindex?

I have a gridview inside repeater controls item template.Gridview has a checkbox field.On checked changed event of checkbox i need the rowindex of grid.Based on this rowindex i want to fetch data from database and display on form.
How to get the rowindex of grid ?

推荐答案

CheckedChanged 事件内,执行如下所示...

Inside the CheckedChanged Event, do like below...
var chk = (Control)sender;
GridViewRow gvRow = (GridViewRow)chk.NamingContainer;
int index = gvRow.RowIndex;


这篇关于在复选框检查已更改的事件上获取转发器内gridview的rowindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆