using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Collections.Specialized;
using System.Collections;

public partial class _Default : System.Web.UI.Page 
{
    DateTime oldDate;
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlDataSource1.Updating += new SqlDataSourceCommandEventHandler(SqlDataSource1_Updating);
        RadGrid1.UpdateCommand += new GridCommandEventHandler(RadGrid1_UpdateCommand);
    }

    void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
    {
        oldDate = Convert.ToDateTime(((GridEditFormItem)(e.Item)).SavedOldValues["OrderDate"]);          
    }

    void SqlDataSource1_Updating(object sender, SqlDataSourceCommandEventArgs e)
    {
        DateTime dateTime = (DateTime)e.Command.Parameters[0].Value;
        e.Command.Parameters[0].Value = new DateTime(oldDate.Year,oldDate.Month,oldDate.Day,dateTime.Hour,dateTime.Minute,dateTime.Second);
    }

}
