Click here to Skip to main content
15,861,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I Have A grid with dropdownlist column i bound dropdownlist from database and a button, when i click on button i want a new row with dropdown using javascript

please help me

thanks in advance
Posted
Updated 25-Aug-14 22:39pm
v2
Comments
David Lee 145 26-Aug-14 4:45am    
I think if you use webform, it's better process with gridview.RowCommand Event than javascript.
See below page, it helps you.

http://msdn.microsoft.com/en-US/library/system.web.ui.webcontrols.gridview.rowcommand(v=vs.110).aspx

1 solution

You can do this using jQuery clone method. But you cannot get the row values on Server Side, when you do a Post Back on any event.

So, you should go to Server Side for this. Either through jQuery Ajax call or simply on Button Click Event.
 
Share this answer
 
Comments
Ravi Sargam 26-Aug-14 4:47am    
can you please tell me how to add row using clone method... because i am new to javascript
Thanks7872 26-Aug-14 5:16am    
You will not be able to get desired results by using any client side methods, I suspect. Go with the server side one.
That I said you to avoid. Do this in server side.

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