Enable filtering in the grid embedded in RadFileExplorer

Thread is closed for posting
4 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 03 Dec 2009 Link to this post

    Requirements

    RadControls version ASP.NET AJAX 2009
    .NET version .NET 3.5
    Visual Studio version   2008
    programming language C# / JavaScript
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    This example shows how to enable filtering in the grid embedded in RadFileExplorer.

    NOTES
    This feature is offered out of the box since Q1 2011. You can see it in action in this online demo.

    THE RESULT




  2. 9F45068F-5D75-46C5-955A-3FD1835A2755
    9F45068F-5D75-46C5-955A-3FD1835A2755 avatar
    21 posts
    Member since:
    Nov 2008

    Posted 22 Dec 2010 Link to this post

    Thanks! Another question, using the code mentioned, how you set filtering to disregard case-sensitivity? I tried adding the line:

    RadFileExplorer1.Grid.GroupingSettings.CaseSensitive = false;

    on page load but it doesn't work.
  3. 93662917-1E03-49EC-9286-033C9D1BF79E
    93662917-1E03-49EC-9286-033C9D1BF79E avatar
    1406 posts
    Member since:
    May 2014

    Posted 27 Dec 2010 Link to this post

    Hi Philip,

    The actual filtering is performed manually in the ExplorerPopulated event and you need to implement case insensitive comparison manually. An example implementation is to pass a second parameter StringComparison.InvariantCultureIgnoreCase to the comparison methods. The required changes are highlighted in the code snipped bellow:
    switch (gridKnownFunction)
    {
        case GridKnownFunction.StartsWith:
            {
                e.List = e.List.FindAll(fi => fi.Name.StartsWith(filterText, StringComparison.InvariantCultureIgnoreCase)).ToList();
            }; break;
        case GridKnownFunction.EndsWith:
            {
                e.List = e.List.FindAll(fi => fi.Name.EndsWith(filterText, StringComparison.InvariantCultureIgnoreCase)).ToList();
            }; break;
        case GridKnownFunction.Contains:
            {
                e.List = e.List.FindAll(fi => fi.Name.ToLower().Contains(filterText.ToLower())).ToList();
            }; break;
    }


    Kind regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. 9F45068F-5D75-46C5-955A-3FD1835A2755
    9F45068F-5D75-46C5-955A-3FD1835A2755 avatar
    21 posts
    Member since:
    Nov 2008

    Posted 27 Dec 2010 Link to this post

    It works now. Thanks!
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.