[Webinar] Streamline your web hosting managementRegister Today


Editable GridView loaded from a dataset

Posted on 2008-02-05
Medium Priority
Last Modified: 2008-02-06
I am trying to make an editable gridview control which does not save to the database.  Instead of saving to the database, I want it to load from a dataset - the dataset will save and update to XML which is stored into a cookie.  For this question, that is really irrilevant, I just wanted to let you know what I am doing.  Instead of saving to XML, I will just save it to session so I can understand more.

Can anyone post an example (html & C#) of an editable gridview that will save the updates to a dataset instead of the database? I can not find any examples of this online - everyone has them bound to a SqlDataSource or ObjectDataSource control, I don't want ot use those.

By an editable gridview, I simply mean one which has an 'edit' button that, when clicked, makes that row editable (say, a textbox for example).  Then, when the user clicks 'save' or 'cancel' (while the row is being edited) it stops editing and simply shows the label so the user can't edit the row.  Instead of saving to the database, I would like it saved to a dataset which is in session (like Session["Myrecords"] = myDataSet;  

I only need a simple example of the gridview - like a gridview with two columns: a label (when not being edited) and a button that says 'Edit'.  Then, when being edited, the label becomes a textbox and the 'Edit' button becomes 'Save' and 'Cancel'.  When the 'Save' button is clicked, the values are stored into a dataset (or datatable).  

Thank you for all of your help!

Question by:stankstank
  • 2
LVL 11

Accepted Solution

vs1784 earned 1500 total points
ID: 20830214
Try the solution in below link, i think its suitable to ur need



Author Comment

ID: 20830421
After looking at that example (it's incomplete) I realize that all I need is an example of how to make the gridview have editable columns... forget the dataset stuff.  If I can figure out how to make it have editable columns, I can figure out the rest.  The link provided has an incomplete answer (it doesn't fully work)

Author Comment

ID: 20830500
I figured it out on my own...  I will give you points anyway...


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

640 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