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 Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RadGrid1.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
    }

    void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        (sender as RadGrid).DataSource = new object[] { DateTime.Now, DateTime.Now };
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Button btn = sender as Button;
        GridEditFormItem editedItem = btn.NamingContainer as GridEditFormItem;
        RadGrid rg = editedItem.OwnerTableView.OwnerGrid;
        rg.EditIndexes.Clear();
        rg.Rebind();
    }
}