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 override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        Session["CategoryID"] = 7;

        EntityDataSource1.Selecting += new EventHandler<EntityDataSourceSelectingEventArgs>(EntityDataSource1_Selecting);
    }

    protected void EntityDataSource1_Selecting(object sender, EntityDataSourceSelectingEventArgs e)
    {
        if (e.DataSource.Where != string.Empty)
        {
            e.DataSource.Where += " AND ";
        }

        e.DataSource.Where += "it.Categories.CategoryID == " + Session["CategoryID"].ToString();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        RadGrid1.ItemCommand += new Telerik.Web.UI.GridCommandEventHandler(RadGrid1_ItemCommand);


    }

    protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {

    }

    protected override void OnPreRender(EventArgs e)
    {

        base.OnPreRender(e);

    }
}
