using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Web.UI;
using System.Web.Mvc;
using System.Collections;

namespace Telerik.Web.UI.Mvc
{
    public class MyGrid : RadGrid
    {

        public MyGrid()
        {
            //
        }

        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (ViewData["ControlID"] != null && ViewData["ControlID"].ToString() == ID &&
                ViewData["CommandName"] != null)
            {
                RaisePostBackEvent(String.Format("FireCommand:{0};{1};{2}", MasterTableView.UniqueID, (string)ViewData["CommandName"], (string)ViewData["CommandArgument"]));
            }
        }

        public ViewDataDictionary ViewData
        {
            get
            {
                return (((ViewPage)Page)).ViewData;
            }
        }
    }
}