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 System.Data.SqlClient;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page
{

    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable table = new DataTable();
        table.Columns.Add("ID");
        table.Columns.Add("Item");
        for (int i = 1; i < 10; i++)
        {
            DataRow row = table.NewRow();
            row["ID"] = i;
            row["Item"] = "Item" + i.ToString();
            table.Rows.Add(row);
        }
        RadGrid1.DataSource = table;
    }
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            GridEditManager editMan = item.EditManager;

            GridDropDownListColumnEditor editor = editMan.GetColumnEditor("Item") as GridDropDownListColumnEditor;
            string itemID = item.OwnerTableView.DataKeyValues[item.ItemIndex]["ID"].ToString();
            DataTable table = new DataTable();
            table.Columns.Add("Item");
            table.Rows.Add(editor.SelectedValue);
            for (int i = 1; i < 5; i++)
            {
                DataRow row = table.NewRow();
                row["Item"] = "Item" + itemID + i.ToString();
                table.Rows.Add(row);
            }
            object temp = editor.DataSource;

            editor.DataSource = table;
            editor.DataBind();

            editor.DataSource = temp;

        }
    }
}
