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

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

    }

    protected override void Render(HtmlTextWriter writer)
    {
        base.Render(writer);
        Profile.Pet = new Pet();
        Profile.Pet.SavePetNames(RadGrid2.MasterTableView, "RadGrid2");
    }



    protected void Page_Init(object sender, EventArgs e)
    {

        if (Profile.Pet.Names.Count > 0)
        {

            /*Columns declared on this grid are done so at design time*/
            if (Profile.Pet.Names.ContainsKey("RadGrid2"))
            {
                GridSettings settings = new GridSettings(RadGrid2.MasterTableView);
                settings.LoadSettings(Profile.Pet.Names["RadGrid2"].ToString());
            }



        }

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
     
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        RadGrid2.MasterTableView.Columns[0].Visible = false;
    }
    protected void RadGrid2_DataBound(object sender, EventArgs e)
    {
        if (Profile.Pet.Names.Count > 0)
        {

            if (Profile.Pet.Names.ContainsKey("RadGrid2"))
            {
                GridSettings settings = new GridSettings(RadGrid2.MasterTableView);
                settings.LoadExpandedStates(Profile.Pet.Names["RadGrid2"].ToString());
            }

        }
    }
}
