Filtering with Leading Space in the string

2 posts, 0 answers
  1. G
    G avatar
    10 posts
    Member since:
    Jul 2013

    Posted 05 Sep 2014 Link to this post


    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.


  2. Viktor Tachev
    Viktor Tachev avatar
    2456 posts

    Posted 09 Sep 2014 Link to this post


    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.

    Viktor Tachev

    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.

Back to Top