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