找到GridView控件 [英] find GridView control

查看:74
本文介绍了找到GridView控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击其他按钮时,在按钮单击事件上创建gridview控件时,我找不到它.

I am not find gridview control when it is creates on a button click event, when I click other button.

推荐答案



您想将所有行保存在数据库中


按钮事件
Hi,

You want to all row save in database


on button event
for(int i=0;i<gv1.rows.count;i++)>
{
  string name=((Textbox)gv.rows[i].findcontrol("GV_textbox1")).Text;
}



您在gridview中的渲染中获得了文本框的值.



You got Value of textbox in render in gridview


在诸如onclick之类的事件中,sender属性是生成它的控件.因此,您的gridview就在那里.您的控件应该被命名,除非您的gridview在另一个数据绑定控件的列中,否则您还应该能够直接通过名称访问它.
In an event, such as onclick, the sender property is the control that generated it. So, your gridview is there. Your controls should be given names, and unless your gridview is in a column of another data bound control, you should also be able to access it by name directly.


这篇关于找到GridView控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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