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;

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

    }

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        RadGrid grid = new RadGrid();        
        grid.ID = "RadGrid2";

        grid.DataSourceID = "SqlDataSource1";
        
        grid.AllowMultiRowSelection = true;
        
        grid.MasterTableView.AutoGenerateColumns = false;

        grid.ClientSettings.Selecting.AllowRowSelect = true;
        grid.ClientSettings.AllowKeyboardNavigation = true;

        grid.ClientSettings.ClientEvents.OnRowSelecting = "rowSelecting";
        grid.ClientSettings.ClientEvents.OnRowDeselecting = "rowDeselecting";
        grid.ClientSettings.ClientEvents.OnKeyPress = "onKeyPressed";
        


        GridBoundColumn column = new GridBoundColumn();
        column.DataField = "EmployeeID";
        column.HeaderText = "Employee ID";
        grid.MasterTableView.Columns.Add(column);

        column = new GridBoundColumn();
        column.DataField = "LastName";
        column.HeaderText = "LastName";
        grid.MasterTableView.Columns.Add(column);

        holder.Controls.Add(grid);


    }
}
