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

Adding folders dynamically on upload button

1 Answer 69 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Bilawal
Top achievements
Rank 1
Bilawal asked on 10 Jan 2013, 08:57 AM
hi everyone, i am new to telerik controls, i have a rad file explorer, code of my explorer is below

 <table cellspacing="4">
        <tr>
            <td rowspan="2" style="vertical-align: top;">
                Browse to an image and double click to preview.
                <telerik:RadFileExplorer runat="server" ID="FileExplorer2" Width="520px" Height="520px"
                    OnClientItemSelected="OnClientItemSelected" 
                    OnClientDelete="OnClientDelete"                     
                    EnableAsyncUpload="True" 
                   >
                    <Configuration ViewPaths="~/Images" UploadPaths="~/Images"
                        DeletePaths="~/Images"></Configuration>
                </telerik:RadFileExplorer>
            </td>
            <td>
                <div id="decoratedZoneFiledset">
                    <fieldset style="width: 230px; height: 220px; margin-top: 14px;">
                        <legend>Preview</legend>
                        <img id="pvwImage" src="Images/Northwind/Flowers/Flower1.jpg" alt="Flower1.jpg"
                            style="display: none; margin: 10px; width: 200px; height: 180px; vertical-align: middle;" />
                    </fieldset>
                </div>
            </td>
        </tr>
        <tr>
            <td valign="top" id="decoratorZone">
               
                <asp:Button ID="Button1" runat="server" Text="Submit" />
            </td>
        </tr>
    </table>
i give uploadpath,viewpath, deletepath initially temperary as the upload button should appear,
i want this, when i click on upload button in code behind i want setting a path from my controls like dropdown.selectedvalue/textbox/imgname how i get this, any help will be appreciated. 
thanks in advance :)

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 15 Jan 2013, 09:29 AM
Hi Bilawal,

If I understand the scenario correctly, you want to add dynamically folders to the FileExplorer's UploadPaths. You should note that the latest moment of the page live cycle where the RadFileExplorer's properties ViewPaths / DeletePaths / UploadPaths can be set is the Page_Load event, and Button_Click event occurs after that. Nevertheless, your scenario can be implemented using the following approach approach:
  • You need to check which control causes Postback
  • Then, change the paths based on the clicked button. Please note that you need to clear the old nodes in order to force the RadFileExplorer to repopulate its content.

For your convenience I have attache a sample project implementing the above mentioned approach, including a RadComboBox in the ToolBar of FileExplorer.


Kind regards,
Vesi
the Telerik team
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 their blog feed now.
Tags
FileExplorer
Asked by
Bilawal
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or