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

[Solved] How to remove elements from Editor's ImageManager?

4 Answers 193 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ricky Mattischeck
Top achievements
Rank 1
Ricky Mattischeck asked on 05 Jan 2010, 02:39 PM
Hi there,

can you please give me a hint (or better some code example *g*) how to remove elements like the foldertree, the url-field and the button to create new folders (as you can see on the screenshot I attached)?

I know how to remove those elements from the FileExplorer but the ImageManager seems to be another component than the FileExplorer but with a similar look.

Thank you very much!

Greetings from Germany.
Ricky Mattischeck

4 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 06 Jan 2010, 09:59 AM
Hi Ricky,

ImageManager, and all the file managers actually , are using RadFileExplorer control to provide file exploring.
In order  to remove a specific element from the dialog you have to create a custom dialog with custom definition of RadFileExplorer or use the ExternalDialogsPath property to provide path to modified dialogs.

RadFileExplorer is defined in FileExplorer.ascx you should locate the following part of the code and modify the VisibleControls property with the required fields:

<telerik:RadFileExplorer ID="RadFileExplorer1" Height="410px" Width="400px" TreePaneWidth="150px"
    runat="Server" EnableOpenFile="false" AllowPaging="true" VisibleControls="Grid,Toolbar" />

Information regarding CustomDialogs and ExternalDialogPath is available in the following articles:
ExternalDialogsPath Property / Customize Built-in Dialogs
Add Custom Dialogs / Add Custom Dialogs(demo)
Custom FileBrowserContent Provider

RadFileExplorer does not provide the functionality to remove a specific button from the toolbar out-of-the-box, however, this is achievable by 'hiding' the button with CSS. Use the following code do so :

<style type="text/css">
.icnNewFolder 
{
    display:none !important
}
</style>

Note that this CSS solution is considered a 'hack' and might not work with future versions of the control.



All the best,
Dobromir
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.
0
Ricky Mattischeck
Top achievements
Rank 1
answered on 07 Jan 2010, 02:43 PM
Hi Dobromir,

thanks for the fast reply and the link to the articles. The first one "ExternalDialogsPath property" did it!
For your second advice, I found another solution which is a better one than a css-hack I think :-)

As if you can set the VisibleControls-property on <telerik:RadFileExplorer>-tag in FileBrowser.ascx, why not also set the EnableCreateNewFolder-property to false?

So my piece of code would look like this:

<telerik:RadFileExplorer ID="RadFileExplorer1" Height="410px" Width="400px" TreePaneWidth="150px"
    runat="Server" EnableOpenFile="false" AllowPaging="true" EnableCreateNewFolder="false" VisibleControls="Grid,Toolbar" />

Greetings,
Ricky
0
Accepted
Dobromir
Telerik team
answered on 08 Jan 2010, 11:56 AM
Hi Ricky,

Please, accept my sincere apologies for not suggesting to use the mentioned property - indeed, this is a better approach. However, there are no such properties for all the buttons in the RadFileExplorer control and thus I believe that the CSS technique might be useful in similar cases when there is no a property exposed.

For this particular case, I recommend to stick to the solution you have found.

Greetings,
Dobromir
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.
0
Ricky Mattischeck
Top achievements
Rank 1
answered on 08 Jan 2010, 04:25 PM
No problem for that :-)

But maybe you can help me with a next question, that goes in the same direction like my first... I created a new thread here
Tags
Editor
Asked by
Ricky Mattischeck
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Ricky Mattischeck
Top achievements
Rank 1
Share this question
or