Hello, How to get value of TextBox of GridView in RowEditing and I've textchange event and that textbox value need to update via gridview to database. but before updating we need to calculate that value.
public void calculationA() { TextBox txt_BCICU = (TextBox)grdlist.FindControl("txt_BCICU"); TextBox txt_BCSupDlx = (TextBox)grdlist.FindControl("txt_BCSupDlx"); txt_TotalChargeA.Text = (Convert.ToDecimal(txt_BCSupDlx.Text.Trim()) + Convert.ToDecimal(txt_BCICU.Text.Trim())).ToString(); protected void txt_BCICU_TextChanged(object sender, EventArgs e) { calculationA(); } protected void grdlist_RowUpdating(object sender, GridViewUpdateEventArgs e) { TextBox txt_BCICU = (TextBox)grdlist.Rows[e.RowIndex].FindControl("txt_BCICU"); TextBox txt_BCSupDlx = (TextBox)grdlist.Rows[e.RowIndex].FindControl("txt_BCSupDlx"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)