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 Default2 : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        RadGrid1.ItemCommand += new GridCommandEventHandler(RadGrid1_ItemCommand);
        RadGrid1.ColumnsReorder += new GridColumnsReorderEventHandler(RadGrid1_ColumnsReorder);
    }

    void RadGrid1_ColumnsReorder(object sender, GridColumnsReorderEventArgs e)
    {
        rap1.Alert("Columns reordering");
    }

    void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "RadGridConfigurationChanged")
        {
            rap1.Alert("Configuration changed in table " + e.CommandArgument);
        }


    }

    protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Query", typeof(string));
        dt.Columns.Add("Revenue", typeof(double));
        dt.Columns.Add("Test", typeof(string));
        for (int i = 1; i < 21; i++)
        {
            dt.Rows.Add("Test " + i.ToString(), i / 5, "Test" + i.ToString());
        }
        (sender as RadGrid).DataSource = dt;
    }
}