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

Is the operators dropdown customizable?

2 Answers 77 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Shankar
Top achievements
Rank 1
Shankar asked on 02 Aug 2012, 01:39 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 02 Aug 2012, 07:27 AM
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.

0
Shankar
Top achievements
Rank 1
answered on 02 Aug 2012, 10:18 PM
Awesome! Worked perfect, thanks.
Tags
DataFilter
Asked by
Shankar
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Shankar
Top achievements
Rank 1
Share this question
or