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

Setting size and position of 'Upload' window

1 Answer 176 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
archimede
Top achievements
Rank 1
archimede asked on 20 Jun 2013, 08:22 AM
Good day,

We're using one fileexplorer in a page.
When we press the 'Upload' button of the file explorer, a window appears with file selector open button, overwrite flag, filter label, etc.
We are unable to understand how to position and size the Upload window.

How can we change size and position when opening the Upload window?

We'd like to also know:
- Is it possible to change the 'Filename' and 'Size' labels of the file explorer?
- Is it possible to set size and position of the -file open- window (the one that appears when pressing 'Select' in the upload window)?

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 25 Jun 2013, 08:11 AM
Hello Archimede,

Regarding your first question, in order to change the position of the Upload Dialog, you will need to get a reference to the upload window in the ClientClick event of the 'Upload' button and use the window moveTo() method. To do so, you will have to attach a handler to the button's click event on the server, as in the following example where OnClientUploadClick is the JavaScript function that will handle the event:
Default.aspx.cs

protected
void Page_Load(object sender, EventArgs e)
{
    RadFileExplorer1.ToolBar.OnClientButtonClicked = "OnClientUploadClick";
}

The following JavaScript goes to your main page. Feel free to modify the assigned values, so that they better fit your project's requirements.
JavaScript

function
OnClientUploadClick() {
    //implement your logic for the desired position of the window
    var xPos = 100;
    var yPos = 100;
 
    //setTimeout to allow some time for the window reference to be created
    setTimeout( function() {
        var curWnd = $find("RadFileExplorer1").get_windowManager().getActiveWindow();
        if (curWnd.get_title() == "Upload") {
            curWnd.moveTo(xPos,yPos);
        }
    },40);
}

For convenience I am attaching the sample project I have used to test the functionality.

As for changing the 'Filename' and 'Size' label, you can refer to the following two articles, which give an in-depth explanation of how to achieve this:
All you need to do is copy the RadEditor.Dialogs.resx file into App_GlobalResources folder and edit the relative entries in the table. The specific values that you need to change are: Common_SortBySize and Common_SortByFilename.

To answer your third question, I am afraid that there is a browser limitation that does not allow us to change the position of the File Browser Dialog.

I hope that you will find the provided information helpful.

Regards,
Ivaylo
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
FileExplorer
Asked by
archimede
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Share this question
or