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

Changing default group operator

1 Answer 47 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Mark DeMichele
Top achievements
Rank 1
Mark DeMichele asked on 12 Aug 2011, 07:28 PM
Hi,

With regards to the RadFilter, how would one change the default group operator whenever a group is created? Specifically, I'd like each group to default to OR instead of AND.

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 17 Aug 2011, 01:17 PM
Hello Mark,

Please use the following code in order to implement the desired functionality:
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        RadFilter1.RootGroup.GroupOperation = RadFilterGroupOperation.Or;
    }      
}
 
protected void RadFilter1_ItemCommand(object sender, RadFilterCommandEventArgs e)
{
    if (e.CommandName == RadFilter.AddGroupCommandName)
    {
        e.Canceled = true;
        RadFilterGroupExpression group1 = new RadFilterGroupExpression();
        group1.GroupOperation = RadFilterGroupOperation.Or;
        (e.ExpressionItem as Telerik.Web.UI.RadFilterGroupExpressionItem).Expression.AddExpression(group1);
        RadFilter1.RecreateControl();
    }
}

I hope it helps.

Best wishes,
Mira
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Filter
Asked by
Mark DeMichele
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or