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 void FilterButton_Click(object sender, EventArgs e)
    {
        GridFilteringItem item = RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
        TextBox textBoxFilterOrderId= item["OrderID"].Controls[0] as TextBox;
        string filterOrderId = textBoxFilterOrderId.Text;

        TextBox textBoxFilterOrderDate = item["OrderDate"].Controls[0] as TextBox;
        string filterOrderDate = textBoxFilterOrderDate.Text;
        DateTime dt = DateTime.Parse(filterOrderDate);

        string expression = "([OrderID] = " + filterOrderId + ") AND ([OrderDate] = \'" + dt + "\')";
        RadGrid1.MasterTableView.FilterExpression = expression;

        GridColumn columnID = RadGrid1.MasterTableView.GetColumnSafe("OrderID");
        columnID.CurrentFilterValue = filterOrderId;

        GridColumn columnDate = RadGrid1.MasterTableView.GetColumnSafe("OrderDate");
        columnDate.CurrentFilterValue = filterOrderDate;

        RadGrid1.MasterTableView.Rebind();
    }
}
