Hi,
We are using LINQ for all data operations. Please, take a look at this
article.
Here is the important part.
Distinct Values
The filtering control that the user is presented with has two parts. The upper part of the control displays distinct values found in the respective column. The values that you see at any moment are the ones that are left after all other column filters have been applied. In other words, these values are collected from the visible rows only. This behavior can easily be configured as described in this article.
The string representations that are displayed to the user are produced by taking the raw distinct value from the source collection and then applying the column’s DataMemberBinding IValueConverter and DataFormatString if any. For example, if you have specified a currency DataFormatString for your column, the user will see a nicely formatted $ 2.22 in the distinct values list. However, underneath this nicely formatted string the original Float value will be preserved and will be used for performing the actual filtering inside the data engine. One of the most common pitfalls is thinking that an IValueConverter defined on the DataMemberBinding of the column will affect the data operations in any way. It will not. The DataMemberBinding IValueConverter and the DataFormatString of the column are used for UI purposes only. They can only change the appearance of data into something more user-friendly such as $ 2.22, but they do not play any role in the data engine. Filtering is always performed with raw data values.
Field Filters
The lower part of the control represents the two field filters. These are two filtering criteria joined by a logical operator. The field filters allow the user to create filtering criteria like “age is greater than 18 and is less than 60”. Each field filters consists of two parts. The upper part is a combo box that allows the user to specify the type of comparison to be made, i.e. Is Equal To, Is Less Than, and so on. These are called filter operators. The available filter operators depend on the data type of the column. For example, for string columns you will see string-specific operators such as Contains and Is Contained In, whereas for numeric and date columns you will see the comparison operators Is Greater Than, Is Less Than, etc. Hereyou can find a table describing the available filter operators based on the column data type. If you want to remove some of the available filter operators that the user is presented with or change the operator that is selected by default you can use the FilterOperatorsLoading event of RadGridView as described here.
The lower part of the field filter is called the field filter editor. Again, the editor that the user will see depends on the column data type. For example, if you have a date column the user will be able to enter the filtering criteria through a date time picker control. Depending on the column data type the most suitable editor is selected and used. Of course, you can always plug-in your very own field filter editor as described in this article. If you want to modify the appearance or behavior of the stock field filter editor that we have selected for you, you can easily do that by attaching to the FieldFilterEditorCreated event of RadGridView as demonstrated here.
In short, since we are using LINQ for sorting, filtering and grouping (which very often goes all the way to SQL Server for example) those data operations can only be performed on the actual raw data -- not its UI representation.
Now onto your case.
You can develop a custom field filter editor (i.e. TextBox for example) that is smart enough to accept what the user enters and then convert it to the raw data value before it is sent via the LINQ Where query. Developing a custom field filter editor is described in this article.
I have attached a sample project that does something similar to this: it accepts percentage values like "30%" from the user and converts them to the correct double which is 0.30.
Please, examine, run and debug the sample project. It should get you started.
I hope this helps.
All the best,
Rossen Hristov
the Telerik team