Hi i am trying to add a new row to the GridView using javascript or jquery. I am not using code behind code as i do not want the page to get refreshed so i am trying in javascript. I have tried the following code and it did add a new row.. but the new row is a clone or copy of first row... wich i do not want... means i need same kind of row when i click on add new row but the id of that row inside grid view should be different which is not happening as i am doing clone... and code is used was.. :
function AddNewRecord()
{
var grd = document.getElementById('ctl00_ContentPlaceHolder1_griddetails');
var tbod=grd.rows[0].parentNode;
var newRow=grd.rows[grd.rows.length - 1].cloneNode(true);
tbod.appendChild(newRow);
}
on the button click i am calling this js function but since it has clone node it is just copying same id to next row in gridview which i do not need... so can u please help me as to how can i modify this code to create new row with details as of first but with new id...
Thanking u in advance!