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

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {        
    }

    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = conn;
        cmd.CommandText = "Select * from Orders";
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        da.Fill(dt);

        RadGrid1.DataSource = dt;
    }

    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        for (int i = 0; i < RadGrid1.PageSize; i++)
            RadGrid1.EditIndexes.Add(i);
        RadGrid1.Rebind();  
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        GridItem[] items = RadGrid1.MasterTableView.GetItems(GridItemType.EditItem);
        foreach (GridItem item in items)
        {
            GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)((GridDataItem)item).EditManager.GetColumnEditor("ShipName");
            string text = editor.TextBoxControl.Text;
        }        
    }
}
