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

Operators for DataFilter

3 Answers 9 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Lori
Top achievements
Rank 1
Lori asked on 16 Jul 2014, 12:53 PM
My datafilter displays the IsNull and IsNotNull operator for anything defined as a type = string.   My users would like these to show up under the operator drop down when they selected a value that is defined as a int32.   

I found this in telerik documentation and it looks like these should appear for any filter type:

When choosing the Operator, you have to make sure that the respective MemberType supports this operator. For example, you cannot use the Contains operator if your MemberType is Int32 because the data engine will crash. Here is a table of filter operators and the types that support them.
Filter Operators and Types Supporting Them


Operators                                                                                                                                                                      Types


IsEqualTo, IsNotEqualTo                                                                                                                                               All filterable types

StartsWith, EndsWith, Contains, DoesNotContain, IsContainedIn, IsNotContainedIn, IsEmpty, IsNotEmpty    String

IsLessThan, IsLessThanOrEqualTo, IsGreaterThan, IsGreaterThanOrEqualTo                                                     Numeric types, DateTime, TimeSpan, all types
                                                                                                                                                                                         that overload these .Net operators

IsNull, IsNotNull                                                                                                                                                                All filterable types
 
 I noticed that in the telerik demos for datafilter the IsNull and IsNotNull operators only show for strings.   Is it possible to add these to the operator dropdown for anything defined as a numeric value?

Thanks,

Lori

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 17 Jul 2014, 02:41 PM
Hello Lori,

If your data is of type null-able Int32, etc. then the IsNull and IsNotNull operators will be presented. Otherwise, it is not possible to have any null values, so you do not need those operators.

Thank you for your note, I will update the text in the documentation to avoid any misunderstanding.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Lori
Top achievements
Rank 1
answered on 18 Jul 2014, 11:41 AM
I am not using the data filter in a grid, I was referring to a raddatafilter.  I am using the raddatafilter to build a select statement to query a table from an external source.    I have a table containing available columns, these are defined as strings, int32, and date.   When a column is selected that is an int32, I wanted to have the IsNull and IsNotNull operators show up so that I can correctly build my sql.   There are null values in the numeric field in the external customers table.  
0
Dimitrina
Telerik team
answered on 18 Jul 2014, 02:42 PM
Hello Lori,

In that case, I can suggest you adding a generic filter descriptor (FilterDescriptor<T>) to build the proper LINQ query to filter on manunally.

You can check the Use generic FilterDescriptor documentation for an example on how to do so. The article is for RadGridView, however, the same logic applies for RadDataFilter.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DataFilter
Asked by
Lori
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Lori
Top achievements
Rank 1
Share this question
or