CustomProvider How Can I filter files with custom filter parameter?

2 posts, 0 answers
  1. iomega 55
    iomega 55 avatar
    64 posts
    Member since:
    Dec 2004

    Posted 06 Dec 2009 Link to this post

    I have created a user control with a FileExporer inside (myUCFileExplorer). The FileExplorer uses a CustomProvider, as in the code library:
    Code Library CustomProvider Sample

    How can I pass a parameter for filtering the files in the CustomerProvider. I want to have in the same web form various myUCFileExplorer, so I need to pass a parameter for each myUCFileExplorer for having a filter independent from each other.

    In the samples here in the forum the class has this function:
    private bool IsFiltered(string name) 
            { 
                if (name.ToLower().EndsWith(".sys") || name.ToLower().Contains("Some")) 
                { 
                    return false
                } 
     
                // else 
                return true
            } 
     But it's harcoded the filter.

    Any comment is welcomed.




  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 08 Dec 2009 Link to this post

    Hello Iomega,

    You can use this code

    Page _page = this.Context.CurrentHandler as Page;
    in order to get reference to the Page object that contains the user control that contains the RadFileExplorer. Then you can find the user control and get the values from that page. For example you can use a hidden field. The rest of the implementation, however, is a comm programming task and you need to implement it yourself.

    Additionally, I recommend you check this and this code library as well.

    I hope this helps.

    All the best,
    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.
Back to Top