<asp:TemplateColumn HeaderText="Amount"> <itemtemplate> <asp:TextBox ID="txtAmount" runat="server" CssClass="txAlign" Width="100px" MaxLength="15" AutoPostBack="true" OnTextChanged="txtAmount_TextChanged" Text='<%# DataBinder.Eval(Container.DataItem,"c5") %>'> </itemtemplate>
protected void txtAmount_TextChanged(object sender, EventArgs e) { double totalval = 0.00; foreach (DataGridItem item in dgBill.Items) { if (((TextBox)item.FindControl("txtAmount")).Text!= "") { totalval = Convert.ToDouble(totalval) + Convert.ToDouble(((TextBox)item.FindControl("txtAmount")).Text); } } txtTotAmount.Text = totalval.ToString(); }
CssClass="txAlign"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)