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

RadFilter. Prohibit some boolean operators in filter expressions

4 Answers 92 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 10 Jan 2011, 06:20 PM
Hello Telerik team,

First of all, thank you for bringing web components, to the next level! 

I would like to ask, whether there is a way to remove some boolean operators, e.g. all except for AND, to simplify filter expression? We need to simplify end user experience, hence would like to remove unnecessary options (OR, NOT OR, NOT AND).

Thanks in advance!

Ivan

4 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 11 Jan 2011, 09:18 AM
Hello Ivan,

You can use the following code snippet in order to reduce the options in the menu for RadFilter
<script type="text/javascript">
                function pageLoad()
                {
  
                    $find('<%=Filter.ClientID %>').get_contextMenu().add_showing(
function (sender, args)
{
    sender.findItemByValue("Or").set_visible(false);
    sender.findItemByValue("NotAnd").set_visible(false);
    sender.findItemByValue("NotOr").set_visible(false);
}
);
                }
            </script>


Best wishes,
Nikolay
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.
0
Ivan
Top achievements
Rank 1
answered on 11 Jan 2011, 10:58 AM
Worked just fine, thank you!


Ivan
0
July
Top achievements
Rank 2
answered on 04 Aug 2011, 05:05 PM
I need do this in code behind.
How I do this?
0
Pavlina
Telerik team
answered on 08 Aug 2011, 05:16 PM
Hello Julieta,

You can remove the NotAnd and NotOr group operations server-side as shown below:
protected void Page_Load(object sender, EventArgs e)
{
RadFilter1.Localization.GroupOperationNotAnd = "";
RadFilter1.Localization.GroupOperationNotOr = "";
}

Regards,
Pavlina
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
Ivan
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Ivan
Top achievements
Rank 1
July
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or