I have a gridview with products details , and a quantity textbox which I added-it's not connected to any DB.I want it to display for each row the cost (price*quantity) and the total cost for all rows (in label bellow).I have a few problems with it.1. It enters a 0 in the quantity textbox, so I need to update the quantity to 1 all the time, and then it calculates. I know also maybe this can be done better in C# in the rowdataboundevent, suggestions would be appreciated.please help me undarstand what's wrong.Here is the code: \[code\]<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script> <script type="text/javascript">$(function () { $("[id*=lblquantity]").val("0"); });$("[id*=lblquantity]").live("change", function () { if (isNaN(parseInt($(this).val()))) { $(this).val('0'); } else { $(this).val(parseInt($(this).val()).toString()); } }); $("[id*=lblquantity]").live("keyup", function () { if (!jQuery.trim($(this).val()) == '') { if (!isNaN(parseFloat($(this).val()))) { var row = $(this).closest("tr"); $("[id*=lblTotal]", row).html(parseFloat($(".price", row).html()) * parseFloat($(this).val())); } } else { $(this).val(''); } var grandTotal = 0; $("[id*=lblTotal]").each(function () { grandTotal = grandTotal + parseFloat($(this).html()); }); $("[id*=lblGrandTotal]").html(grandTotal.toString()); $("[id*=hfGrandTotal]").val(grandTotal.toString()) }); </script>\[/code\]and here is the code of the gridview in ASP.net.\[code\] <asp:HiddenField ID="hfGrandTotal" runat="server" /> <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" EnableViewState="False" onrowdatabound="GridView2_RowDataBound"> <Columns> <asp:BoundField DataField="Price" HeaderText="Price" ItemStyle-CssClass="price" ><ItemStyle CssClass="price"></ItemStyle> </asp:BoundField> <asp:TemplateField HeaderText="ProductID"> <ItemTemplate> <asp:Label ID="lblID" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ProductName"> <ItemTemplate> <asp:Label ID="lblName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Summary"> <ItemTemplate> <asp:Label ID="lblSum" runat="server" Text='<%# Eval("Summary") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="picPath"> <ItemTemplate> <asp:Label ID="lblPic" runat="server" Text='<%# Eval("picPath") %>' ></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText = "quantity"> <ItemTemplate> <asp:TextBox ID="lblquantity" runat="server" ></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText = "Total"> <ItemTemplate> <asp:Label ID="lblTotal" runat="server" ></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>\[/code\]thanx