Grid MasterTableView FilterExpression is blank on Special Chars like (%,[,],",<,>,,...) is passed from google like filtering

8 posts, 0 answers
  1. Sanjeev
    Sanjeev avatar
    17 posts
    Member since:
    Jun 2007

    Posted 26 Apr 2010 Link to this post

    Hi,
        We have an issue for GooleLike Filtering, we have a GoogleLike Filtering when we type special charcters like %,[,],<,> ...etc then the GoogleLike Filtering is not working. I drilled down to deep and found that when we pass normal text to column then the FilterExpression is getting formed as needed and Filtering working as desired, But When we pass and the text  with some special characetrs then FilterExpression is not getting formed and the grid filetring is not working.


    Thanks,
    Sanjeev
  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 29 Apr 2010 Link to this post

    Hello Sanjeev,

    The reason for the observed behavior is due to RadGrid's escaping the sepcial characters for security reasons. Here is the grid's property responsible for that:

    public static string[] IllegalStrings
    {
        get
        {
            if (_illegalStrings == null)
            {
                _illegalStrings = new string[] { " LIKE ", " AND ", " OR ", "\"", ">", "<", "<>", " NULL ", " IS " }; 
            }
            return _illegalStrings;
        }
        set
        {
            _illegalStrings = value;
        }
    }

    Hence, if you need some of those chars not to be escaped just change the illegal strings array as follows:

    protected void Page_Load(object sender, EventArgs e)
    {
        GridFilterFunction.IllegalStrings = new string[]{ " LIKE ", " AND ", " OR ", " NULL ", " IS " };
    }

    Hope this information helps.

    Regards,
    Tsvetoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sanjeev
    Sanjeev avatar
    17 posts
    Member since:
    Jun 2007

    Posted 04 May 2010 Link to this post

    Hi Tsvetoslav,
                          Thanks for the reply, it's worked for all special characters except %, [, ], and * can you provide some more details on that.

    Thanks
    Sanjeev
  5. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 10 May 2010 Link to this post

    Hello Sanjeev,

    Just set EnableLinqExpressions=true for the grid and those characters will be taken into account as part of the filter value.

    Best wishes,
    Tsvetoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Engin
    Engin avatar
    1 posts
    Member since:
    Oct 2011

    Posted 27 Oct 2011 Link to this post

    If you set the EnableLinqExpressions to true , then the single quote is not working . The sample grid application on the Telerik site (http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx) is also setting this attribute to false so it works with the apostrophe.

    In my application, I set it to false and redefine the escape characters as you suggested, and now both the ' and " characters are working on my filter; However, not those special characters. I don't understand why we cannot filter by all these characters and switching the EnableLinqExpressions attribute also switches between the ability to filter by these characters. Isn't there any other way?
  7. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 28 Oct 2011 Link to this post

    Hi Engin,

    The single quote does work on my side. Could you upgrade to the latest version of the controls and test it? If the problem persists, do give more details on how to reproduce it.

    Best wishes,
    Tsvetoslav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  8. zAxis
    zAxis avatar
    13 posts
    Member since:
    Aug 2010

    Posted 17 May Link to this post

    Maybe I'm just being a bit dense today, but I fail to see how
    " AND " is a security risk
    while " And " or " and " is not.

    Looks more like a poorly thought out rule to me.

     

  9. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 23 May Link to this post

    Hello,

    That's a really good point actually. Initially, Transact-SQL keywords consist only of uppercase letters:
    https://msdn.microsoft.com/en-us/library/ms177563.aspx

    Therefore, this limitation logic may be a legacy code from the first versions of RadGrid. Generally, you can remove these operators from the illegal strings collection:
    http://www.telerik.com/forums/radgrid-filter-with-and-and-or#iMR601r2eUqBd4tiWXBrWg

    Thank you for bringing this issue to our attention for further consideration. I've updated your Telerik points as a token of gratitude.

    Regards,
    Eyup
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017