RadGridView - Search as you type

2 Answers 336 Views
GridView
minh
Top achievements
Rank 2
Iron
Iron
Iron
minh asked on 02 Nov 2022, 07:56 AM

Dear Telerik support team,

I have got some problems with "Search as you type" function of RadGridView as below:

1. The search is not working with negative number. Example: in my grid, there is cell that contains the number -700. When I tried to type -700 in search box, nothing is happened.

2. I would like to search the formatted values, for example: 2.34 %, but the search is based on original value only. Do you have any workaround to achieve this behavior excepted the addition property as we have many grids with many properties already.

3. I want to search a number (decimal type) as string. It mean that I have a number 123.567 in a cell, i would to find this cell/row by typing only "123". Do you have any solution for that excepted to add a new property having string type?

 

Many thanks for your help,

Minh Tuan

2 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 02 Nov 2022, 12:49 PM

Hi Minh,

I will try to address your inquiries in the order you've defined them:

1. By default, the search-as-you-type functionality treats the "-" symbol as an operator as specified here. Any text after the minus sign should not be contained by the compared value for it to pass the filter. To actually look for the value -700, you need to wrap the search text in quotation marks - "-700".

2. and 3. The default searching behavior has two ways of setting the operator of the filtering criteria, depending on the value type of the property over which the search is performed. For a string and Enum type, the operator is set to Contains. For all other types, the operator is set to IsEqualTo. With this in mind, the only way to achieve the desired result would be to introduce additional calculated properties which hold the string representation of the numeric values so that searching can be performed as expected.

I hope you find this information helpful. Do let me know if the proposed approaches would work for you.

Regards,
Dilyan Traykov
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.

0
minh
Top achievements
Rank 2
Iron
Iron
Iron
answered on 03 Nov 2022, 09:17 AM

Hi Dilyan,

 

Many thanks for your answers and suggestion, that guide me to some pitch of solutions.

So, I have another question, when I have some custom in RowStyle, the highlight of search doesn't work any more.

Do you have any solution for that?

Many thanks in advance

 

Dilyan Traykov
Telerik team
commented on 04 Nov 2022, 12:54 PM

Hi Minh,

I'm glad to hear you found my answer helpful.

Can you please specify how you've defined the custom RowStyle? I tried applying such at my end, but the search results are still highlighted.

If possible, please modify the sample project to demonstrate your setup and send it back to me so that I can suggest a viable solution.

Tags
GridView
Asked by
minh
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dilyan Traykov
Telerik team
minh
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or