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 _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = e.Item as GridDataItem;
            (item["TemplateColumn"].FindControl("Timer1") as Timer).Interval = 2000;
        }
    }

    public void Timer1_Tick(object sender, EventArgs e)
    {
        GridDataItem item = (sender as System.Web.UI.Timer).Parent.Parent.Parent as GridDataItem;
        (item["TemplateColumn2"].FindControl("Label1") as Label).Text = DateTime.Now.TimeOfDay.ToString();
    }

    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = e.Item as GridDataItem;
            (item["TemplateColumn"].FindControl("Timer1") as Timer).Tick += new EventHandler<EventArgs>(Timer1_Tick);
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(item["TemplateColumn"].FindControl("Timer1"), item["TemplateColumn2"].FindControl("Label1"));
        }
    }


}
