I am used the method javascript method to add row to g=rid view dyanamically in javascript.
but when i write something in my text box and then add row then text also copied but i want to add empty row to grid view
here is my grid view
<asp:GridView runat="server" CssClass="gridcss" ID="dgvCargoPrd" AutoGenerateColumns="False"
OnRowDeleting="dgvCargoPrd_RowDeleting" ShowFooter="True">
<Columns>
<asp:TemplateField HeaderText="Item Description">
<ItemTemplate>
<asp:TextBox ID="txtItemDesc" runat="server" Width="120px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="QTY">
<FooterTemplate>
Total:
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="txtQty" runat="server" Width="45px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Amount">
<ItemTemplate>
<asp:TextBox ID="txtAmount" runat="server" Width="60px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:Button runat="server" Text="Del" ID="btnDelete" OnClientClick="return DeleteRow(this);" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
and here is the method to add row
function addRow() {
var row = $("#<%=dgvCargoPrd.ClientID %> tr:last").prev("tr").clone(true);
var last = $("[id*=dgvCargoPrd] tr:last").clone(true);
$("#<%=dgvCargoPrd.ClientID %> tr:last").remove();
$("[id*=dgvCargoPrd]").append(row);
$("[id*=dgvCargoPrd]").append(last);
return false;
}
row added but with their text i want to add empty textboxes !!
plz hlep