(文本框)e.Row.FindControl(QUOT;特... [英] (TextBox)e.Row.FindControl("Te...
本文介绍了(文本框)e.Row.FindControl(QUOT;特...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在gridview模板字段中,
(TextBox)e.Row.FindControl(TextBox13)=?
如何分配来自datatable的值。
解决方案
您好,
试试这个:
// DataTable对象
DataTable dt = < span class =code-keyword> new DataTable();
// 查找文本框控件
TextBox txtId =(TextBox)e.Row .FindControl( txtId);
// 让我们说你想要第一行的数据。你可以在这里使用循环
DataRow dr = dt.Rows [ 0 ];
txtId.Text = Convert.ToString(dr [ ColumnName]);
In gridview template field,
(TextBox)e.Row.FindControl("TextBox13") = ?
How to assign values for this from datatable.
解决方案
Hi,
Try this:
//DataTable Object DataTable dt = new DataTable(); //Find textbox control TextBox txtId = (TextBox)e.Row.FindControl("txtId"); //Lets say u want the data from the first row. U can use loop here DataRow dr = dt.Rows[0]; txtId.Text = Convert.ToString(dr["ColumnName"]);
这篇关于(文本框)e.Row.FindControl(QUOT;特...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文