Click here to Skip to main content
15,907,492 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
* Need to add new row from jquery to asp.net grid;

* the row contains 4 tds with 4 textboxes.

* Need to access the row like gridview.rows[i]. like that
Posted

try something like this.
C#
function AddNewRecord()
        {
            var grd = document.getElementById('GridView1');
            var tbod=grd.rows[0].parentNode;
            var newRow=grd.rows[grd.rows.length - 1].cloneNode(true);
            tbod.appendChild(newRow);
            return false;

        }


Check this to know more.

http://stackoverflow.com/questions/8499357/grid-adding-row-with-javascript[^]
 
Share this answer
 
Comments
Kartheek.chakrala 13-Aug-12 7:39am    
with this ids and name will not differ.
tried with Request.Form['Name of the input''];

collected all the names generated from client side with hidden feild;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900