Solved

Client side add rows to Gridview

Posted on 2010-08-20
8
744 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now