RadFilter. Prohibit some boolean operators in filter expressions

5 posts, 1 answers
  1. Ivan
    Ivan avatar
    3 posts
    Member since:
    Oct 2010

    Posted 10 Jan 2011 Link to this post

    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
  2. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 11 Jan 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ivan
    Ivan avatar
    3 posts
    Member since:
    Oct 2010

    Posted 11 Jan 2011 Link to this post

    Worked just fine, thank you!


    Ivan
  5. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 04 Aug 2011 Link to this post

    I need do this in code behind.
    How I do this?
  6. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 08 Aug 2011 Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017