Link to home
Start Free TrialLog in
Avatar of stankstank
stankstank

asked on

Editable GridView loaded from a dataset

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!

StankStank
ASKER CERTIFIED SOLUTION
Avatar of vs1784
vs1784

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stankstank
stankstank

ASKER

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)
I figured it out on my own...  I will give you points anyway...

Stank