3 Answers, 1 is accepted
Hello Martin,
If I understood the question correctly, yes, you can use the search panel to search in columns containing numeric values. Please refer to this small Dojo example for reference.
If that is not exactly what you had in mind, please get back to me with some additional details, and I will happily assist you.
Regards,
Martin
Progress Telerik
Hi Martin,
I forgot an important information. I use serverfiltering and the .ToDataSourceResult() method throws an error on my side if I try to search for numeric fields because it can't apply the contains method to a numeric column.
Thanks in advance.
Hello Martin,
The new search panel can be used with all types only with client operations, i.e. -> ServerFiltering(false). What actually happens is that a filter expression for each of the fields is composed and then applied to the data source. This would work on the client-side due to the fact that the values that do not match the value would not throw an error.
However, on the server-side, a strongly-typed environment, the search panel would try filtering numeric and DateTime objects by a string. And this would cause an exception.
Having that said, I would recommend adding only the string columns to the search option.
Another possible approach to filter non-string types on the server is to modify the filters on the server. An example how this could be achieved is available in this forum thread.
Let me know if you have further questions.
Regards,
Author nickname
Progress Telerik