using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page
{
    protected object VisibleColumn(string columnName)
    {
        object dataBind = string.Empty; ;
        foreach (GridColumn col in radgrid.MasterTableView.AutoGeneratedColumns)
        {
            if (col.UniqueName.Equals(columnName))
            {
                dataBind = Eval(columnName);
                return dataBind;
            }
        }
        return string.Empty;
    }

    protected void radgrid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        DataTable table = new DataTable();
        table.Columns.Add("OrderId");
        table.Columns.Add("Cost");
        table.Columns.Add("RefundAmount");
        for (int i = 1; i < 100; i++)
        {
            table.Rows.Add(i.ToString(), (i+1).ToString(), (i+2).ToString());
        }

        (sender as RadGrid).DataSource = table;
    }
}
