如何传递字符串值网格视图的文本框模板? [英] How to pass string value grid view`s text box template?

查看:64
本文介绍了如何传递字符串值网格视图的文本框模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个将从网格视图(grdPurchaseOrder)中获取数据的代码,可以将特定行中的相同数据分配给字符串(stritems).

这是我的代码:

for(int i = 0; i< grdPurchaseOrder.Rows.Count; i ++)
{

字符串stritems =(((TextBox)grdPurchaseOrder.Rows [i] .FindControl("txtitems")).Text;
}


现在我有了字符串数据,我想将其传递给网格视图到我们想要的行....我只需要上面代码的相反过程,请帮助我如何将字符串值插入到特定行? div class ="h2_lin">解决方案

这将起作用

((TextBox)grdPurchaseOrder.Rows [i] .FindControl("txtitems")).Text = stritems;


Hi,
I have a code that will fetch a data from grid view(grdPurchaseOrder) and the same data from particular row can be assigned to string (stritems) .

Here is my code:

for (int i = 0; i < grdPurchaseOrder.Rows.Count; i++)
{

string stritems = ((TextBox)grdPurchaseOrder.Rows[i].FindControl("txtitems")).Text;
}


Now i have string data,i want to pass the same to the grid view to our desired row....I just need a reverse process of above code,please help me how to insert the string value to a particular row??

解决方案

this will work

((TextBox)grdPurchaseOrder.Rows[i].FindControl("txtitems")).Text = stritems;


这篇关于如何传递字符串值网格视图的文本框模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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