To customize a RadHtmlField we managed adding a project specific CSS file easily:
:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
base.radEditorControl.AllowScripts = true;
base.radEditorControl.CssFiles = new string[]{ "/styles/css/styles.css" };
:
The editor shows all classes that can be found in styles.css in the "Apply CSS class" dropdown. Cool.
Beside a lot of other style definitions this CSS file contains classes like:
.SaiaStylesCustom-Saia-Text
{
font-size: 12px;
font-weight: normal;
font-family: Arial, Helvetica, sans-serif;
color: #212121;
}
We now would like to see just these .SaiaStylesCustom-xxx-xxx classes in the dropdown. Therefore we added the following in the OnLoad event handler:
:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
base.radEditorControl.AllowScripts = true;
base.radEditorControl.CssFiles = new string[] { "/styles/css/editorstyles.css" };
try
{
base.radEditorControl.CssClasses.Add(".SaiaStylesCustom-Saia-Text ", ".SaiaStylesCustom-Saia-Text");
:
We expected the dropdown to show just the classes we added, but we still can see all the other once present in the CSS file. Any idea what we're doing wrong? Help would be appreciated.