e.g. here:
<asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" DataKeyNames="ProductId">
<Columns>
<asp:BoundField DataField="ProductName" HeaderText="Product Name" />
<asp:BoundField DataField="UnitPrice" HeaderText="Unit Price" />
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox ID="txtQuantity" runat="server" OnTextChanged="txtQuantity_TextChanged" Text="0" AutoPostBack="true"> </asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
<asp:Label ID="lblPrice" runat="server" Text=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void txtQuantity_TextChanged(object sender, EventArgs e)
{
TextBox tb = (TextBox) sender;
GridViewRow row =(GridViewRow) tb.NamingContainer;
decimal unitprice = Convert.ToDecimal(row.Cells[1].Text);
int quantity = Convert.ToInt32(tb.Text);
Label lblPrice = (Label)row.FindControl("lblPrice");
lblPrice.Text = (unitprice * quantity).ToString();
}