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 _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    public DataTable GetData
    {
        get
        {
            if (Session["Data"] == null)
            {
                DataTable table = new DataTable();
                table.Columns.Add("ID");
                table.Columns.Add("Name");
                table.Columns.Add("IsHead", typeof(Boolean));
                for (int i = 1; i <= 10; i++)
                {
                    table.Rows.Add(i, "Name" + i.ToString(), (i == 1 ? true : false));
                }
                Session["Data"] = table;
            }
            return (DataTable)Session["Data"];
        }
    }
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = GetData;
    }
    
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            RadComboBox combo = (e.Item as GridDataItem)["TemplateColumn"].FindControl("RadComboBox1") as RadComboBox;
            combo.DataSource = GetData;
        }
    }
}
