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

public partial class FrozenColumns2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable tbl = new DataTable();
        tbl.Columns.Add(" Column Number 1 ");
        tbl.Columns.Add(" Column Number 2 ");
        tbl.Columns.Add(" Column Number 3 ");
        tbl.Columns.Add(" Column Number 4 ");
        tbl.Columns.Add(" Column Number 5 ");
        tbl.Columns.Add(" Column Number 6 ");
        tbl.Columns.Add(" Column Number 7 ");
        tbl.Columns.Add(" Column Number 8 ");
        tbl.Columns.Add(" Column Number 9 ");
        tbl.Columns.Add(" Column Number 10 ");
        for (int i = 0; (i <= 40); i++)
        {
            DataRow row = tbl.NewRow();
            for (int j = 0; (j <= 9); j++)
            {
                row[j] = ("test data (" + (j + ("," + (i + ")"))));
            }
            tbl.Rows.Add(row);
            RadGrid1.DataSource = tbl;
        }
    }

    protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        e.Column.HeaderStyle.Width = Unit.Pixel(200);
        e.Column.ItemStyle.Width = Unit.Pixel(200);

        if (e.Column.UniqueName == " Column Number 2 ")
        {
            e.Column.Visible = false;
        }
    }

}
