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.Data;

public partial class _Default : System.Web.UI.Page
{

    public DataTable DT
    {
        get
        {
            if (Session["DT"] == null)
            {
                DataTable table = new DataTable();
                table.Columns.Add("Date", typeof(DateTime));
                DataRow row = table.NewRow();
                row["Date"] = DBNull.Value;
                table.Rows.Add(row);
                Session["DT"] = table;
            }

            return Session["DT"] as DataTable;
        }
        set
        {
            Session["DT"] = value;
        }
    }
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
        Button1.Click += new EventHandler(Button1_Click);
    }

    void Button1_Click(object sender, EventArgs e)
    {
        var date = RadDatePicker1.SelectedDate;
        if (date != null)
        {
            DT.Rows[0]["Date"] = date;
            RadGrid1.Rebind();
        }
    }

    void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = DT;
    }
}
