using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using System.Data.OleDb;
using System.Collections;
using Telerik.Web.UI.Calendar;

public partial class _Default : System.Web.UI.Page
{
    private DataTable GridSource
    {
        get
        {
            Object obj = this.ViewState["_gds"];
            if (obj != null)
            {
                return (DataTable)obj;
            }
            else
            {
                OleDbConnection MyOleDbConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("~/App_Data/Nwind.mdb"));
                OleDbDataAdapter MyOleDbDataAdapter = new OleDbDataAdapter();
                MyOleDbDataAdapter.SelectCommand = new OleDbCommand("SELECT TOP 10 CategoryID, CategoryName FROM Categories", MyOleDbConnection);
                DataTable myDataTable = new DataTable();
                MyOleDbConnection.Open();
                try
                {
                    MyOleDbDataAdapter.Fill(myDataTable);
                }
                finally
                {
                    MyOleDbConnection.Close();
                }

                this.ViewState["_gds"] = myDataTable;
                return myDataTable;
            }
        }
    }   

    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = this.GridSource;
    }

   

}
