Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > FileExplorer > Enable filtering in the grid embedded in RadFileExplorer

Not answered Enable filtering in the grid embedded in RadFileExplorer

Feed from this thread
  • Posted on Dec 3, 2009 (permalink)

    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




    Reply

  • Philip avatar

    Posted on Dec 22, 2010 (permalink)

    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.

    Reply

  • Fiko Fiko avatar

    Posted on Dec 27, 2010 (permalink)

    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.

    Reply

  • Philip avatar

    Posted on Dec 27, 2010 (permalink)

    It works now. Thanks!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > FileExplorer > Enable filtering in the grid embedded in RadFileExplorer