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

[Solved] Customizing RADEditor Toolbar

3 Answers 414 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Shehan Peruma
Top achievements
Rank 1
Shehan Peruma asked on 13 Jul 2009, 08:12 PM
Hi,

I need some help in customizing the RADEditor toolbar I have on a masterpage. Below are the steps I did to get the control to appear on the page
1) Registered the assembly in the masterpage
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2008.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"%>

2)Added the control to the page:
<asp:ScriptManager ID="ScriptManager1" runat="server" />                    
<telerik:RadEditor ID="RadEditor1" runat="server" Width="500" Height="500" ></telerik:radeditor>

The RADEditor now appears on the page. However it has all the toolbar icons appearing. I followed the steps in here and created a new toolfile with only the icons I need to appear. However when I refresh the page containing the control I get the following error:
[DirectoryNotFoundException: Could not find a part of the path 'c:\windows\system32\inetsrv\~\ToolsFile_custom.xml'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +193
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +64
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) +77
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +54
System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) +74
System.Threading.CompressedStack.runTryCode(Object userData) +70
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) +0
System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) +108
System.Xml.XmlTextReaderImpl.OpenUrl() +186
System.Xml.XmlTextReaderImpl.Read() +208
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +112
System.Xml.XmlDocument.Load(XmlReader reader) +108
System.Xml.XmlDocument.Load(String filename) +87
Telerik.Web.UI.RadEditor.get_ToolsFileContent() +183
Telerik.Web.UI.ToolsFileLoader.LoadColors(EditorColorCollection colors) +55
Telerik.Web.UI.RadEditor.LoadToolsFile(Boolean loadOnlyEmptyCollections) +154
Telerik.Web.UI.RadEditor.set_ToolsFile(String value) +55
T_RadEditor_ToolsFile_61.SetProperty(Object , Object ) +86
System.Web.Util.FastPropertyAccessor.SetProperty(Object target, String propName, Object val) +55
System.Web.UI.PropertyMapper.SetMappedPropertyValue(Object obj, String mappedName, Object value) +36
System.Web.UI.ControlBuilder.SetSimpleProperty(SimplePropertyEntry entry, Object obj) +94

[HttpException (0x80004005): '~/ToolsFile_custom.xml' could not be set on property 'ToolsFile'.]
System.Web.UI.ControlBuilder.SetSimpleProperty(SimplePropertyEntry entry, Object obj) +210
System.Web.UI.ControlBuilder.InitSimpleProperties(Object obj) +157
System.Web.UI.ControlBuilder.InitObject(Object obj) +162
System.Web.UI.ControlBuilder.BuildObjectInternal() +238
System.Web.UI.ControlBuilder.BuildObject() +4
System.Web.UI.ControlBuilder.BuildChildren(Object parentObj) +403
System.Web.UI.ControlBuilder.InitObject(Object obj) +342
System.Web.UI.ControlBuilder.BuildObjectInternal() +238
System.Web.UI.ControlBuilder.BuildObject() +4
System.Web.UI.ControlBuilder.BuildChildren(Object parentObj) +403
System.Web.UI.TemplateBuilder.InstantiateIn(Control container) +302
Microsoft.SharePoint.WebControls.TemplateBasedControl.CreateChildControls() +279
CKS.EBE.WebControls.BaseForm.CreateChildControls() +15
System.Web.UI.Control.EnsureChildControls() +87
Microsoft.SharePoint.WebControls.TemplateBasedControl.OnLoad(EventArgs e) +65
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

My custom file is located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.2.0__1f131a624888eeed\Resources
Which happens to be the location where the default RAD files are located.

Can anyone help with this?

3 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 14 Jul 2009, 07:51 AM
Hello Shehan Peruma,

I suggest you to upgrade to the latest version of RadEditor for MOSS, which now is 5.5.0.

In order to get it you should go to the Downloads section under your account, click on the Visual Studio Extensions, DLLs, Scripts, Source Code, DNN and MOSS wrappers ... link and download the RadEditor for MOSS: (zip, 13 MB) installation. You can see the attached screenshot for more information.

You can find upgrade instructions in the following help article http://www.telerik.com/help/aspnet-ajax/upgrade_to_a_newer_version_of_radeditor_for_moss.html.

Regarding your problem I suggest you to use the MOSSRadEditor control, which is defined in the Telerik.SharePoint name space of the RadEditorSharePoint.dll, instead the RadEditor form Telerik.Web.UI. Also if you are using the RadEditor for MOSS in WCM scenario check this article http://www.telerik.com/help/aspnet-ajax/using-radeditor-in-web-content-management-scenario.html.

Afterwords you will be able to modify the tools by changing the ToolsFile.xml, which is located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.5.0.0__1f131a624888eeed\Resources folder. For more info view the following online help article http://www.telerik.com/help/aspnet-ajax/removing-tools-from-toolbar.html.

I hope this helps.

Kind regards,
Stanimir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Shehan Peruma
Top achievements
Rank 1
answered on 14 Jul 2009, 03:54 PM
Thanks for replying, but upgrading to the new version at present is not possible, due to process considerations.

I did try to use the MOSSRadEditor in place of the RadEditor control, but I still get the same error when I use a custom tools file

<telerik:MOSSRadEditor  ID="RADComment" runat="server" Width="500" Height="500" OnClientLoad="OnClientLoad" OnClientCommandExecuted="OnClientCommandExecuted" ToolsFile="~/ToolsFile_custom.xml" ></telerik:mossradeditor>


Could not find a part of the path 'c:\windows\system32\inetsrv\~\ToolsFile_custom.xml'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\windows\system32\inetsrv\~\ToolsFile_custom.xml'.

0
Stanimir
Telerik team
answered on 15 Jul 2009, 06:40 AM
Hi Shehan,

When you are using the MOSSRadEditor control there is no need to specify the ToolsFile. You can modify the ToolsFile.xml, which is located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\x.x.x.x__1f131a624888eeed\Resources folder.

You can not use this setting ToolsFile="~/ToolsFile_custom.xml". I do not think that you can address the custom ToolsFile this way. You can address it by pleacing it somewhere under the 12 hive or the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources foder. And then add this code.
For example if you place the file in the wpresources folder, you should have the following setting.
ToolsFile="/_wpresources/ToolsFile_custom.xml"

I hope this helps.

Sincerely yours,
Stanimir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Shehan Peruma
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Shehan Peruma
Top achievements
Rank 1
Share this question
or