using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Collections;
using Telerik.Web.UI;
using System.Data;
using System.Configuration;

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

    }

    private static DataTable GetDataTable(string queryString)
    {
        String ConnString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
        SqlConnection MySqlConnection = new SqlConnection(ConnString);
        SqlDataAdapter MySqlDataAdapter = new SqlDataAdapter();
        MySqlDataAdapter.SelectCommand = new SqlCommand(queryString, MySqlConnection);

        DataTable myDataTable = new DataTable();
        MySqlConnection.Open();
        try
        {
            MySqlDataAdapter.Fill(myDataTable);
        }
        finally
        {
            MySqlConnection.Close();
        }

        return myDataTable;
    }

    private DataTable Employees
    {
        get
        {
            object obj = this.Session["Employees"];
            if ((!(obj == null)))
            {
                return ((DataTable)(obj));
            }
            DataTable myDataTable = new DataTable();
            myDataTable = GetDataTable("SELECT * FROM Employees");
            this.Session["Employees"] = myDataTable;
            return myDataTable;
        }
    }

    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        this.RadGrid1.DataSource = this.Employees;
        this.Employees.PrimaryKey = new DataColumn[] { this.Employees.Columns["EmployeeID"] };
    }


    protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
    {
      
    }
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
      
    }


    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {

    }
}

