Here's a sample for you
GridView
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Item" HeaderText="Item" />
<asp:BoundField DataField="Price" HeaderText="Price"/>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox ID="txtQuantity" runat="server" OnTextChanged = "Quantity_Changed" AutoPostBack = "true"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total">
<ItemTemplate>
<asp:Label ID="lblTotal" runat="server" Text="0"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] { new DataColumn("Item"), new DataColumn("Price"), new DataColumn("Total") });
dt.Rows.Add("Shirt", 200, 0);
dt.Rows.Add("Football", 30, 0);
dt.Rows.Add("Bat", 22.5, 0);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void Quantity_Changed(object sender, EventArgs e)
{
TextBox txtQuantity = (sender as TextBox);
GridViewRow row = (txtQuantity.NamingContainer as GridViewRow);
Label lblTotal = (row.FindControl("lblTotal") as Label);
lblTotal.Text = (int.Parse(txtQuantity.Text) * int.Parse(row.Cells[1].Text)).ToString();
}