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

Parameter?

1 Answer 57 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Reiner Ebel
Top achievements
Rank 1
Reiner Ebel asked on 20 Oct 2009, 05:51 PM
Hello, I have a big Problem. I call the Fileexplorer with the Button from client side:

function OpenFileExplorerDialog(val) {  
            _globobjectartselect = val;  
            var wnd = $find("<%= ExplorerWindow.ClientID %>");  
            wnd.set_navigateUrl("../../filemanager/explorer.aspx?search=" + val);  
            wnd.show();  
        }  
 
function OnFileSelected(wnd, fileSelected) {  
            switch(_globobjectartselect)  
            {  
                case "Picture":  
                    var textbox = $find("<%= txtPictureFilePath.ClientID %>");  
                    textbox.set_value(fileSelected);  
                    break;  
                case "Video":  
                    var textbox = $find("<%= txtVideoFilePath.ClientID %>");  
                    textbox.set_value(fileSelected);  
                    break;  
            }  
        } 

I pass a parameter to the link wnd.set_navigateUrl(). This parameter is to set the search pattern.

Fileexplorer:

protected void Page_Load(object sender, EventArgs e)  
    {  
        if (Request.QueryString["search"] != null && Request.QueryString["search"] != "")  
        {  
            switch (Request.QueryString["search"])  
            {  
                case "Picture":  
                    string[] patterns1 = { "*.jpg", "*.jpeg", "*.gif", "*.png", "*.bmp" };  
                    RadFileExplorer1.Configuration.SearchPatterns = patterns1;  
                    break;  
                case "Video":  
                    string[] patterns2 = { "*.mpg", "*.mpeg", "*.avi", "*.divx", "*.wmv" };  
                    RadFileExplorer1.Configuration.SearchPatterns = patterns2;  
                    break;  
            }              
        }  
    } 

This works fine for one call. When i call the picture object first then its ok. In the second call the search patterns are soon the patterns from Picture. The Explorer does not load the new settings.

How can I solve the problem? Its very important for me.

Thank you

Reiner

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 23 Oct 2009, 11:00 AM
Hi Reiner,

In your scenario I recommend you set the ReloadOnShow="true" in ExplorerWindow's declaration. This will cause the RadWindow's content to be reloaded every time it is shown. Also you could set it on the client by using this approach:

function OpenFileExplorerDialog(val) { 
            _globobjectartselect = val; 
            var wnd = $find("<%= ExplorerWindow.ClientID %>");
            wnd.set_set_reloadOnShow(true);
            wnd.set_navigateUrl("../../filemanager/explorer.aspx?search=" + val); 
            wnd.show(); 
        }

This will cause the window to be reloaded (the Page_Load event to be called) every time ExplorerWindow is shown).
I hope this helps.

Sincerely yours,
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
Reiner Ebel
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or