This is a migrated thread and some comments may be shown as answers.

CustomProvider How Can I filter files with custom filter parameter?

1 Answer 42 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 07 Dec 2009, 03:56 AM
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.




1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 08 Dec 2009, 02:54 PM
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.
Tags
FileExplorer
Asked by
iomega 55
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or