0
我有一个gridview,因为我在项目模板中使用超过5个文本框我想插入文本框中存在的值到表任何主体plz给你的sugesstion如何插入在gridview中存在的文本框的值
我尝试以下方法其示出错误我写在按钮点击事件
TextBox txtprod = (TextBox)sender;
GridViewRow row = (GridViewRow)txtprod.Parent.Parent;
int rowIndex = row.RowIndex;
TextBox txtDetails
=(TextBox)GridView2.Rows[rowIndex].Cells[1].FindControl("txtProd");
TextBox txtQuoQuantity=(TextBox)GridView2.Rows[rowIndex].Cells[3].FindControl("txtQuantity");
TextBox txtTax = (TextBox)GridView2.Rows[rowIndex].Cells[6].FindControl("txtTax");
TextBox txtQuoRate = (TextBox)GridView2.Rows[rowIndex].Cells[4].FindControl("txtrate");
TextBox txtQuoDis = (TextBox)GridView2.Rows[rowIndex].Cells[5].FindControl("txtDis");
TextBox txtQuoAmount = (TextBox)GridView2.Rows[rowIndex].Cells[7].FindControl("txtAmt");
亚我试图FindControl方法其示值误差,供您参考这里我贴我的代码 – kaarthikeyan