?
Solved

Client side add rows to Gridview

Posted on 2010-08-20
8
Medium Priority
?
754 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Technology Partners: 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!

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

770 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