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

old value during GridEditableItem

4 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Swapnil
Top achievements
Rank 1
Swapnil asked on 02 Sep 2014, 07:45 AM
this is my updatecommand code , i get new values but i want old value also how can i get it

GridEditableItem EditItem = e.Item as GridEditableItem;
            RadTextBox txtTestName = (RadTextBox)EditItem["ActiVityName"].FindControl("txtTestName");
            Hashtable newValues = new Hashtable();
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, EditItem);
            string NewActivityName = newValues["ActivityName"].ToString();
//WANT OLD VALUE HERE
Thanks

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 02 Sep 2014, 07:49 AM
Hello,

Go through the article below which demonstrates how to retrieve the original values for edited item:
http://www.telerik.com/help/aspnet-ajax/grid-retrieve-original-values-for-edited-item.html

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Swapnil
Top achievements
Rank 1
answered on 02 Sep 2014, 07:56 AM
tried but giving error at session . object not set to an instance of object.
0
Swapnil
Top achievements
Rank 1
answered on 02 Sep 2014, 10:56 AM
can i get oldvalue which i can see while debugging in "EditItem"?
Thanks.
0
Pavlina
Telerik team
answered on 04 Sep 2014, 05:08 PM
Hi,

I tried the code below and it works without problems:
protected void RadGrid1_ItemUpdated(object sender, Telerik.Web.UI.GridUpdatedEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem eitem = (GridEditableItem)e.Item;
        Hashtable Hashtable1 = new Hashtable();
        Hashtable1 = (Hashtable)eitem.SavedOldValues;
        string oldTextBoxValue = Hashtable1["txtTestName"].ToString();
    }
}

Try it out and let me know if it works for you.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Swapnil
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Swapnil
Top achievements
Rank 1
Share this question
or