This is a migrated thread and some comments may be shown as answers.

Initial filter when using range filtering

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dawson
Top achievements
Rank 1
Dawson asked on 21 Dec 2013, 12:56 PM
Hi,
how to have initial filter when using range filtering.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Dec 2013, 01:06 PM
Hi Dawson,

Please try the following code snippet:

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        RadGrid1.MasterTableView.FilterExpression = "(([Date] >= '01/01/13') AND ([Date] <= '01/04/13'))";
        GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("Date");
        column.CurrentFilterFunction = GridKnownFunction.Contains;
        column.CurrentFilterValue = "01/01/13 01/04/13";
        RadGrid1.MasterTableView.Rebind();
    }
}

Thanks,
Princy


Tags
Grid
Asked by
Dawson
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or