Client side add rows to Gridview

Hi Experts,
I want to create a Gridview,in which I can add single/multiple rows.
I want to save these rows o database on click of a save button which is outside of gridview.
Need to add new rows with javascript,so I can add textboxes,dropdown where user can enter his detail
These rows may be multiple.
Need to save all this data on save button.
For Edit and delete,it should be normal like we use for Gridview,
whenever I have rows from database ,Edit/Delete are visible and user can persom this operation.

Please let me know if you want any other information.
Your help is really appreciated.
LVL 8
Johny BravoAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Kamal KhaleefaConnect With a Mentor Information Security SpecialistCommented:
yes
you can do the following
when you click add rows
in code behind store the current gridview with its values into a session
then add the row
and then rebind the grid with the session
and keep doing that
now when u want to save
read ur data from the session and also read the last row in the grid because it is not saved yet to the session
0
 
Johny BravoAuthor Commented:
I am trying http://geekswithblogs.net/AzamSharp/archive/2008/02/06/119332.aspx
but having a problem with this,
when I click 'Add new' and enter some data in it and if again I click 'Add New',previous entries are lost.
May be anyone casn throw light on this.
0
 
Kamal KhaleefaInformation Security SpecialistCommented:
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Johny BravoAuthor Commented:
Hi,
Thanks for the link, but there is no way I can add new rows at client side.
What I need, user can add multiple rows in the gridview at a time and then clicking a single save,all data will be saved.
This link has functionality to add rows
http://geekswithblogs.net/AzamSharp/archive/2008/02/06/119332.aspx

but if I click 'Add new' after entering any record,that entry is lossed.

0
 
Kamal KhaleefaInformation Security SpecialistCommented:
yes it is lost because it is not saved to the database yet

if you notice in the example he click add rows many times before he fill the details
then he fill the details and click update
0
 
Johny BravoAuthor Commented:
Hmm thanks for pointing that, but can we make such functionality so that I can have those records even after hitting 'Add new'.
Or same functionality using javascript.


0
 
Kamal KhaleefaInformation Security SpecialistCommented:
also see the following link

http://forums.asp.net/p/1299021/2539186.aspx
0
 
Johny BravoAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.