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

RadGrid: How to get SaveOldValues in Hashtable

1 Answer 196 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tan
Top achievements
Rank 1
Tan asked on 17 Apr 2012, 04:39 AM

protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
e.Item.SavedOldValues.Value;
TextBox newCompanyName = (TextBox)item.FindControl("Company_NameTextBox"); // Get new Value
 
// Get Old Value but can't find Label while in ItemUpdated
TextBox newCompanyName = (TextBox)item.FindControl("Company_NameLabel");  
 
}

I want get the value as screenshot below, anyone know how to get the SaveOldValue?



Thanks
From, Tan

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 17 Apr 2012, 06:58 AM
Hi Tan,

Here is the code I tried to get the SaveOldValue.

C#:
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["TextBoxID"].ToString();
 
    }
}

Hope this helps.
Thanks,
Shinu.
Tags
Grid
Asked by
Tan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or