简体   繁体   English

GridView行更新问题与文本框

[英]Gridview row update problem with text box

I have one gridview. 我有一个gridview。 The grid view does not update the text box value -- whenever I click update, it takes my old text box value only. 网格视图不会更新文本框值-每当我单击更新时,它仅采用我的旧文本框值。

This is my C# code: 这是我的C#代码:

TextBox txtqty = (TextBox)productGridView.Rows[e.RowIndex].Cells[0].FindControl("txtQty");
int qty = Convert.ToInt32(txtqty.Text.Trim());

If anyone could provide some assistance, I would appreciate it. 如果有人可以提供帮助,我将不胜感激。

the following code will give you the text of the textbox... 以下代码将为您提供文本框的文本...

string st=convert.toint32(((textbox)(productgridview.rows[e.rowindex].findcontrol("txtQty"))).text);

the above code will definitely work. 上面的代码肯定会起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM