Tomk01 says:
$(
"[id*=gvOrders] tr"
).not($(
"[id*=gvOrders] tr:first-child"
)).remove();
if
(customers.length > 0) {
$.each(customers, function () {
var customer = $(
this
);
$(
"td"
, row).eq(0).html($(
this
).find(
"NameId"
).text());
$(
"td"
, row).eq(1).html($(
this
).find(
"ProductName"
).text());
$(
"td"
, row).eq(2).html($(
this
).find(
"DateOfProductSales"
).text());
$(
"td"
,row).eq(3).html($(
this
).find(
"Productamount"
).text());
$(
"[id*=gvOrders]"
).append(row);
row = $(
"[id*=gvOrders] tr:last-child"
).clone(
true
);
});
Replace the above code with below code.
$("[id*=gvOrders] tr").not($("[id*=gvOrders] tr:first-child")).remove();
if (customers.length > 0) {
$.each(customers, function () {
var customer = $(this);
var d = $(this).find("DateOfProductSales").text().substr(0, 10).split("-");
d = d[2] + "/" + d[1] + "/" + d[0];
$("td", row).eq(0).html($(this).find("NameId").text());
$("td", row).eq(1).html($(this).find("ProductName").text());
$("td", row).eq(2).html(d);
$("td", row).eq(3).html("$" + parseFloat($(this).find("Productamount").text()).toFixed(2));
$("[id*=gvOrders]").append(row);
row = $("[id*=gvOrders] tr:last-child").clone(true);
});