当前位置: 代码迷 >> ASP.NET >> 关于gridview 编辑模版取值有关问题~急~~~·
  详细解决方案

关于gridview 编辑模版取值有关问题~急~~~·

热度:1658   发布时间:2013-02-26 00:00:00.0
关于gridview 编辑模版取值问题~急~~~·
在gridview中把一列设置成编辑模版
在EditItemTemplate中添加一个textbox控件
问题是在RowUpdating事件中如何取textbox控件的值
谢谢~···

------解决方案--------------------------------------------------------
VB: CType(GridView1.Rows(e.RowIndex).FindControl( "qty1 "), TextBox).Text
------解决方案--------------------------------------------------------
GridViewRow gr = this.GridView1.Rows[e.RowIndex];

TextBox tb = (textBox)gr.findcontrol( "textboxname ")

string 值 = tb.text


------解决方案--------------------------------------------------------
((TextBox)GridView1.Rows[GridViewUpdatedEventArgs].FindControl( "控件名称 ")).Text;

试一下吧