[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Client side add rows to Gridview

Posted on 2010-08-20
8
Medium Priority
?
758 Views
Last Modified: 2013-11-08
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.
0
Comment
Question by:johny_bravo1
  • 4
  • 4
8 Comments
 
LVL 8

Author Comment

by:johny_bravo1
ID: 33483567
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
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 33484679
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 33484846
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 33490523
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
 
LVL 8

Author Comment

by:johny_bravo1
ID: 33491611
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
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 2000 total points
ID: 33493276
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
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 33493282
also see the following link

http://forums.asp.net/p/1299021/2539186.aspx
0
 
LVL 8

Author Closing Comment

by:johny_bravo1
ID: 33519593
Thanks
0

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month20 days, 11 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question