protected void txt_amt_TextChanged(object sender, EventArgs e) { try { TextBox txt = (TextBox)sender; GridViewRow gvRow = (GridViewRow)txt.Parent.Parent; int I = gvRow.RowIndex; TextBox txt_lg = (TextBox)gvRow.FindControl("txt_lg"); TextBox txt_am = (TextBox)gvRow.FindControl("txt_amt"); Button btn = (Button)gvRow.FindControl("BtnAdd"); bl.ld_nm = txt_lg.Text; int i = Convert.ToInt32(dl.select_ld_grpid(bl)); if (i == 15) { double ex = Convert.ToInt32(txt_am.Text); double net = Convert.ToInt32(txt_net_amt.Text) + ex; txt_net_amt.Text = Convert.ToString(net); } else if (i > 28) { bl.ac_ty_id = Convert.ToString(i); int j = Convert.ToInt32(dl.select_grp_grpid(bl)); if (j == 15) { double ex = Convert.ToInt32(txt_am.Text); double net = Convert.ToInt32(txt_net_amt.Text) + ex; txt_net_amt.Text = Convert.ToString(net); } else { } } else { } btn.Focus(); } catch { } }