using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class Default : System.Web.UI.Page
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
        RadGrid1.ItemDataBound += new GridItemEventHandler(RadGrid1_ItemDataBound);
    }

    void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        //if (e.Item is GridDataItem)
        //{
        //    GridDataItem item = e.Item as GridDataItem;
        //    if (item["Money"].Text == "$")
        //    {
        //        item["Money"].Text = "";
        //    }
        //}
    }

    void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable table = new DataTable();
        table.Columns.Add("ID");
        table.Columns.Add("Item");
        table.Columns.Add("Date", typeof(DateTime));
        table.Columns.Add("Money", typeof(double));
        for (int i = 1; i < 8; i++)
        {
            if (i < 5)
            {
                table.Rows.Add(i, "Item" + i.ToString(), DateTime.Now.AddDays(i), 1.20);
            }
            else
            {
                table.Rows.Add(i, "Item" + i.ToString(), DateTime.Now.AddDays(i), null);
            }
        }
        RadGrid1.DataSource = table;
    }
}
