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

Editor icon

1 Answer 108 Views
Editor
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 22 Jul 2009, 12:00 AM

I have built a RadEditor .cs class that i drop onto pages that require the editor tool.
Following is a part of the class where i create a custom button.
How do I add an icon/image to the button within the cs class. 
Icon currently default to a question mark.
is the only way to do tihs within CSS.

public class Editor: RadEditor
{
 public Editor()
 {
  EditorToolGroup etg = new EditorToolGroup();
   EditorTool
 Custom = new EditorTool();
   etg.Tools.Add(Custom);
 }
}

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 22 Jul 2009, 05:22 AM
Hello mike,

Yes, the only way of setting an icon to a command of RadEditor is via CSS. However, as you have already created your custom command, the work is almost done. In a few words - a button of RadEditor constists of an <a /> element, with a nested <span />. The CSS classname of the <span /> is the name of the command. If your command name is "custom", then the rendered <span /> will be <span class="custom" />. And:

span.custom
{
    background: transparent url('custom.gif') no-repeat center !important;
}

Do not remove the !important flag at the end of the property values, otherwise your settings will be overwritten by ours.

Kind regards,
Martin Ivanov
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
mike
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or