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

How to implement custom RadGridView Search ?

1 Answer 353 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Devid
Top achievements
Rank 1
Devid asked on 05 Feb 2019, 04:11 PM
Is it possible to overwrite the RadGridView Search logic and implement a custom search logic ?
My Problem is that the search works only good on text. In our grid we have columns with Date and / or columns with numbers. The search performs really poor on these types. 

I attached two gif files to showcase my problem.

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 08 Feb 2019, 11:48 AM
Hi Devid,

The default search mechanism performs an IsEqualTo comparison on the numeric and DateTime values as opposed to the Contains comparison made on columns of different type and I'm afraid that there's no straightforward way to modify this behavior.

With this said, what I can suggest in order to achieve the desired result would be to introduce separate properties holding the string representation of your numeric/DateTime columns, set their IsVisible property to False and set the CanUserSearchInHiddenColumns property of the RadGridView control to True. Please note, however, that highlighting the matched text will not be possible with this approach.

For your convenience, I'm attaching a small sample project to demonstrate what I have in mind.

Please let me know if you would find this applicable.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Devid
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or