Is the operators dropdown customizable?

3 posts, 1 answers
  1. Shankar
    Shankar avatar
    26 posts
    Member since:
    Dec 2011

    Posted 01 Aug 2012 Link to this post

    I am using RadDataFilter in the following manner:
    Just to build a list of conditions that users can query the database.

    Our data is huge and thus we cannot bring all data and let the RadDataFilter control filter it. Rather, we are just using this control to get the list of conditions from the user, and then we query database to get the result set.

    So, for example, if an element (column in the database) is of type "string (varchar)", I do not want to see all the options in the operator dropdown. Depending on what element is being filtered, I would want to display only certain operators.

    Also, it would be nice to name the operators the way we want to. For example, I want to change the "is equal to" operator to something like "equals", and so on..
  2. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 02 Aug 2012 Link to this post

    Hi,

    You can use the FilterOperatorsLoading event to remove some of the operators that you are not using.

    You can use Localization to change the way operators appear. The keys you are looking for should be the following:

    <data name="FilterContains" xml:space="preserve">
      <value>Contains</value>
    </data>
    <data name="FilterEndsWith" xml:space="preserve">
      <value>Ends with</value>
    </data>
    <data name="FilterIsContainedIn" xml:space="preserve">
      <value>Is contained in</value>
    </data>
    <data name="FilterIsEqualTo" xml:space="preserve">
      <value>Is equal to</value>
    </data>
    <data name="FilterIsGreaterThan" xml:space="preserve">
      <value>Is greater than</value>
    </data>
    <data name="FilterIsGreaterThanOrEqualTo" xml:space="preserve">
      <value>Is greater than or equal to</value>
    </data>
    <data name="FilterIsLessThan" xml:space="preserve">
      <value>Is less than</value>
    </data>
    <data name="FilterIsLessThanOrEqualTo" xml:space="preserve">
      <value>Is less than or equal to</value>
    </data>
    <data name="FilterIsNotEqualTo" xml:space="preserve">
      <value>Is not equal to</value>
    </data>
    <data name="FilterMatchCase" xml:space="preserve">
      <value>Match case</value>
    </data>
    <data name="FilterOr" xml:space="preserve">
      <value>Or</value>
    </data>
    <data name="FilterStartsWith" xml:space="preserve">
      <value>Starts with</value>
    </data>

    I hope this helps.

    Regards,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Shankar
    Shankar avatar
    26 posts
    Member since:
    Dec 2011

    Posted 02 Aug 2012 Link to this post

    Awesome! Worked perfect, thanks.
Back to Top