Telerik - RadEditor basic code example

The Telerik RadEditor has been around long enough to earn a reputation: powerful, and flexible. It’s the control developers reach for when they need rich-text editing inside an ASP.NET WebForms app without reinventing the wheel. But once you start customizing its behavior—cleaning up HTML, controlling formatting, injecting custom tools—you quickly discover that RadEditor is more than a WYSIWYG box. It’s a full-blown editing engine with its own rules, and hidden capabilities. This article walks through the parts that matter most when you’re building real-world applications.
 
When I go to pop the editor into a new form, it's handy to have all the markup ready to go. Usually I'll cut the 'tools' down by at least half, but it's easiest to have a starting place. 

 

<telerik:RadEditor Skin="Web20" ID="RadEditor1" runat="server" Width="100%"
    NewLineBr="False" ToolsFile="~/Tools.xml" NewLineMode="P">
    <CssFiles>
        <telerik:EditorCssFile Value="~/Styles/EditorContentArea.css" />
    </CssFiles>
    <Content>
    </Content>
</telerik:RadEditor>

 EditorContentArea.css:

body
{
    background-color: white;
    font-family: "Segoe UI", Arial, Helvetica, Verdana, sans-serif !important;
    Width:100%;
 }

Tools.xml:

<root>
    <tools name="MainToolbar" enabled="true">
        <tool name="FormatCodeBlock" />
    </tools>
  
    <tools name="InsertToolbar" enabled="true" >
        <tool name="AjaxSpellCheck"/>
        <tool name="ImageManager" shortcut="CTRL+M"/>
        <tool name="DocumentManager" />
        <tool separator="true"/>
        <tool name="InsertTable" />
        <tool name="InsertRowAbove" />
        <tool name="InsertRowBelow" />
        <tool name="DeleteRow" />
        <tool name="InsertColumnLeft" />
        <tool name="InsertColumnRight" />0
        <tool name="DeleteColumn" />
        <tool separator="true"/>
        <tool name="MergeColumns" />
        <tool name="MergeRows" />
        <tool separator="true"/>
        <tool name="SplitCell" />
        <tool name="DeleteCell" />
        <tool name="SetCellProperties" />
        <tool name="SetTableProperties" />
    </tools>
  
    <tools enabled="true">
        <tool name="Undo" />
        <tool name="Redo" />
        <tool separator="true"/>
        <tool name="Cut" />
        <tool name="Copy" />
        <tool name="Paste" shortcut="CTRL+!"/>
        <tool separator="true"/>
        <tool name="PastePlainText" />
        <tool separator="true"/>
        <tool name="FindAndReplace" />
        <tool name="SelectAll" />
        <tool separator="true"/>
        <tool name="InsertHorizontalRule" />
    </tools>
  
    <tools enabled="true" dockable="true">
        <tool name="Bold" />
        <tool name="Italic" />
        <tool name="Underline" />
        <tool separator="true"/>
        <tool name="JustifyLeft" />
        <tool name="JustifyCenter" />
        <tool name="JustifyRight" />
        <tool name="JustifyFull" />
        <tool name="JustifyNone" />
  
        <tool separator="true"/>
        <tool name="Indent" />
        <tool name="Outdent" />
        <tool name="InsertOrderedList" />
        <tool name="InsertUnorderedList"/>
  
        <tool name="LinkManager" />
        <tool name="Unlink" />
    </tools>
  
    <tools name="DropdownToolbar" dockable="true" >
        <tool name="ForeColor" />
        <tool separator="true"/>
        <tool name="FormatBlock"/>
    </tools>
  
  
</root>

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences