This is a migrated thread and some comments may be shown as answers.

Adding rad grid Items to session

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 04 Dec 2012, 08:58 AM
HI,
In the insertcommand, i have the following code:

GridEditableItem item = e.Item as GridEditableItem;
           Hashtable values = new Hashtable();
            item.ExtractValues(values);            
           Session["GridValues"] = values;
           RadGrid1.DataBind();


I am trying to do a soft save of the grid items. When the first row is added it is set in the session. when the 2nd row is added, only the 2nd row values are available in the session.

How to add items in session?

Thanks

1 Answer, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 06 Dec 2012, 01:48 PM
Hello Venkatesh,

The described scenario is caused because you are replacing the value in the Session["GridValues"]. You could achieve your scenario by saving a List<Hastable> in the session variable and then only adding new values in the collection.

Kind regards,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Share this question
or