Limiting filter predicates

4 posts, 0 answers
  1. Grant Fish
    Grant Fish avatar
    10 posts
    Member since:
    Apr 2010

    Posted 23 Jun 2010 Link to this post

    Is there a way to limit or hide the default filter predicates that are displayed? I have no use for Is Null, Is Not Null, or the custom option.
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 29 Jun 2010 Link to this post

    Hello Grant Fish,

    Please find the answer to this question in your support ticket concerning the same topic (Ticket ID 321931). If you have any other questions, we will be glad to help.

    Best wishes,
    Jack
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Anisha
    Anisha avatar
    5 posts
    Member since:
    Apr 2009

    Posted 31 Aug 2010 Link to this post

    Is it possible to post this answer in the forum? I would also like to know how to limit filter predicates.

    Thanks
    Anisha 
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 02 Sep 2010 Link to this post

    Hi Anisha,

    Yes, here is the answer:

    You can customize the available filter actions by handling the ContextMenuOpening event. When handling this event, you have full control over the context menu and can hide or disable any item. Consider the sample below:

    void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
    {
        if (e.ContextMenuProvider == null)
        {
            string isNullName = RadGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadGridStringId.FilterFunctionIsNull);
            RadMenuItem item = FindMenuItem(e.ContextMenu, isNullName);
            if (item != null)
            {
                item.Enabled = false;
            }
        }
    }
      
    private RadMenuItem FindMenuItem(RadDropDownMenu menu, string itemName)
    {
        foreach (RadMenuItem item in menu.Items)
        {
            if (item.Text == itemName)
            {
                return item;
            }
        }
        return null;
    }

    You have a point, we have to implement a more convenient API that allows for customizing the available filter predicates. We will also update our documentation. Please share your opinion on how such an API should look like and should behave. We will consider your feedback when planning our future releases.


    Sincerely yours,
    Jack
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top