gridview 模板中控件使用parent.parent找到对应行索引

来源:互联网 发布:数据管家板块 编辑:程序博客网 时间:2024/05/24 06:41

有个itemTemplate,里面是个linkbutton,

在它的事件里

linkbutton lbtn1=(linkbutton)sender

GridView gv1=(GridView)lbtn1.parent.parent

行索引:gv1.RowIndex

 第一个parent 是指模板?lbtn1.parent.gettype看看.第二個指gridview

原创粉丝点击