GridSearchBox can it trigger a search on ENTER instead of any key press?

1 Answer 231 Views
Grid
Rob
Top achievements
Rank 1
Iron
Iron
Rob asked on 06 Mar 2023, 01:49 PM

Hi,

Is is possible to configure the GridSearchBox in the TelerikGrid Toolbar, so that it searches when the user presses ENTER/RETURN instead of after every key press?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 09 Mar 2023, 08:51 AM

Hello Rob,

Currently, the GridSearchBox always triggers search during typing. You have two options:

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Rob
Top achievements
Rank 1
Iron
Iron
commented on 09 Mar 2023, 02:46 PM

Thanks Dimo,

Unfortunately, I cannot replace the GridSearchBox as that is an internal component to your library, which gives it access to internal features of the Grid. Specifically the CommandName of the TableCommandEventArgs class.

In replacing the text box, we lose all the integrated functionality for filtering/sorting that the GridSearchBox provides, with no way to reproduce them.

Regards,
Rob

Dimo
Telerik team
commented on 09 Mar 2023, 03:48 PM

@Rob - the "access to intenal features" is a bit over-stated. The GridSearchBox helps build filter descriptors for the SearchFilter property of the Grid state. These filter descriptors are then used in the Grid data request. This routine is exactly what the second link shows how to implement manually.

So it is possible to replace the default search box component without losing functionality. You can even mimic the HTML rendering with the icons if you like.

Why do you need the TableCommandEventArgs CommandName?

Rob
Top achievements
Rank 1
Iron
Iron
commented on 09 Mar 2023, 05:17 PM

Thanks for the reply @dimo.

I am incredibly happy using the GridSearchBox to automatically find columns or optionally take a list of columns to search on. This is exactly the functionality I want to use. Only I would like it triggered by an Enter key rather than automatically after key presses.

The link you provided is very good at implementing this for one use case and I am sure with some tweaking I could make it work in a more generic manner. 

My initial investigation into this issue lead into the source for the Telerik Grid to see how it is being done at the moment. I was hoping to extend the existing functionality with wrappers the Telerik editions.

if we have to do it as part of the OnRead event, then so be it.

Regards,
Rob 

Adam
Top achievements
Rank 1
commented on 05 Mar 2025, 06:01 PM

@Dimo you mentioned mimicking the appearance of the GridSearchBox on a TelerikTextBox. Can you elaborate on how to do that?
Tags
Grid
Asked by
Rob
Top achievements
Rank 1
Iron
Iron
Answers by
Dimo
Telerik team
Share this question
or