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.OleDb;
using System.Data;
using System.Collections;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void grid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("~/App_Data/Nwind.mdb"));
        OleDbDataAdapter adapter = new OleDbDataAdapter();
        adapter.SelectCommand = new OleDbCommand("SELECT * FROM Customers", conn);
        DataTable myDataTable = new DataTable();
        conn.Open();
        try
        {
            adapter.Fill(myDataTable);
        }
        finally
        {
            conn.Close();
        }
        grid1.DataSource = myDataTable;
    }
    protected void grid1_UpdateCommand(object source, GridCommandEventArgs e)
    {
        Hashtable oldValues = new Hashtable();
        Hashtable newValues = new Hashtable();
        GridEditableItem editedItem = e.Item as GridEditableItem;
        oldValues = (Hashtable)editedItem.SavedOldValues;
        e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
    }

}