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

Filtering with Leading Space in the string

1 Answer 241 Views
Filter
This is a migrated thread and some comments may be shown as answers.
G
Top achievements
Rank 1
G asked on 05 Sep 2014, 07:10 AM
Hi,

I have used AllowFilteringByColumn in the radgrid and the normal filtering is working ok. Now, one of the column of the grid is FirstName and the data type is string and normal filtering is working. When a firstname contains Leading Space and the filter criteria is 'Equal To' then no result shows  but when the criteria is 'contains' then it shows result. I want to show the show the 'Equal To' criteria result also.
So, how to handle leading space in the filter criteria is 'Equal To'.
Pl, help.

Thanks,

G.Sen

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 09 Sep 2014, 12:31 PM
Hello,

You could add custom code that changes the FilterExpression of the RadGrid when the EqualTo filter is applied. Note, however that this would actually make the filter work incorrectly. The text entered in the input would not be equal to the actual data in the data source. More information on the different formats that are used for FilterExpression is available in this article.

This said, it is recommended to remove the leading spaces from the names that are stored in the data source. This way the filter functions would work as expected.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Filter
Asked by
G
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or