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

Link External CSS files through code behind

1 Answer 135 Views
Editor
This is a migrated thread and some comments may be shown as answers.
amir muhammad
Top achievements
Rank 1
amir muhammad asked on 19 May 2010, 06:51 AM
Hi,

I created this simple RadEditor through code behind, set ToolBar through ToolsDefault.xml and set an external CSS files for styles to appear in "Apply Css Class" drop-down. But they don't appear in the drop down. It works when i create an editor in ".aspx" page. but with code behind the drop-down is empty.

 RadEditor htmlEditor = new RadEditor();  
 htmlEditor.ExternalDialogsPath = "~/EditorDialogs/";  
 htmlEditor.ToolsFile = "~/EditorDialogs/ToolsDefault.xml";  
 htmlEditor.CssFiles.Add("~/EditorDialogs/Test.css");  
 this.form1.Controls.Add(htmlEditor);  

Could you please help! I need to load styles from an external file and i am stuck.

thanks.

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 21 May 2010, 03:31 PM
Hi Amir,

I tried to reproduce the problem on our side but to no avail. Please, make sure that the paths to the files is correct. Also, when applying properties that can be set by the ToolsFile to RadEditor server-side, you need to make sure that the default toolsfile is loaded to avoid overriding the custom values, e.g.:
//.......       
RadEditor htmlEditor = new RadEditor();
htmlEditor.EnsureToolsFileLoaded();
//........
 
If all the paths are correct and the problem still exists, could you please open a support ticket and send a sample project that reproduces the problem?

All the best,
Dobromir
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
amir muhammad
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or