![](/forums/images/avatarimages/default.gif)
4 Answers, 1 is accepted
![](/forums/images/avatarimages/f320b17f-1f44-4099-bc76-bcd007ad7eacavatarsmall1.jpg)
I guess this post gives some kind of answer to your question.
http://www.telerik.com/community/forums/aspnet-ajax/editor/edit-files-directly.aspx
I found it these days because I was also searching for an "extended text editor".
I want (like you) text file edit - and (like the other poster) CSS file edit.
Reading the linked post I decided not to use RadEditor in this case.
So I do two different things
a.) for Textfiles (small ones) I use a normal textbox
Spell is useable - and "formatting" on a textfile :)
b.) for CSS and other specialized filetypes I implemented a download / upload scenario with RadFileExplorer
This is OK for my customer - he uses Visual Studio Express Web for CSS - which gives "WYSIWYG" editing.
Ah, by the way - my HTML content editing is done with RadEditor.
HTH
Manfred
The editor is meant and designed to be used as a HTML editor, and not as textbox (the assumption being that if one needs a textbox one would use a textbox).
Still, the editor does offer some text- and textbox- related features, such as the read-only Text property which returns editor content as pure text, for example.
As far as setting [text] content is concerned, the link provided by Manfred is quite good and will help you in your scenario.
In case you are looking also for more textbox-like RadEditor look II want to point your attention to the following online demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/editorastextbox/defaultcs.aspx
Best regards,
Tervel
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
![](/forums/images/avatarimages/4a460bf2-4af9-4a8f-aa86-528a708a73c3csharp.png)
I was able to get it to work as an extended simple text editor with a little work put in.
1. I used a custom .xml file for the Toolbar to eliminate any richtext features. I just gave the user the very basics of text manipulation but much more than a textbox would give you. I felt this was needed because the users would be editing text that would go out in form emails from my application.
2. I created methods to do conversion just before loading into the editor object (ConvertCrToBr) and an html scrub on the output (ScrubOutHtml).
I am sure even more improvements could be made or something I am not anticipating but it seems to be working well for me for what I need it for.
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
root
>
<
modules
>
<
module
name
=
"RadEditorStatistics"
dockingZone
=
"Bottom"
/>
</
modules
>
<
tools
name
=
"Clipboard"
tab
=
"Home"
>
<
tool
name
=
"PasteStrip"
size
=
"large"
/>
<
tool
name
=
"Cut"
size
=
"medium"
/>
<
tool
name
=
"Copy"
size
=
"medium"
shortcut
=
"CTRL+C"
/>
<
tool
name
=
"Print"
size
=
"medium"
shortcut
=
"CTRL+P"
/>
</
tools
>
<
tools
name
=
"Editing"
tab
=
"Home"
>
<
tool
name
=
"Undo"
shortcut
=
"CTRL+Z"
/>
<
tool
name
=
"FindAndReplace"
shortcut
=
"CTRL+F"
/>
<
tool
name
=
"SelectAll"
shortcut
=
"CTRL+A"
/>
<
tool
name
=
"Redo"
shortcut
=
"CTRL+Y"
/>
</
tools
>
<
tools
name
=
"Content"
tab
=
"Insert"
>
<
tool
name
=
"InsertDate"
/>
<
tool
name
=
"InsertTime"
/>
</
tools
>
<
tools
name
=
"Zoom"
tab
=
"View"
>
<
tool
name
=
"Zoom"
/>
</
tools
>
<
tools
name
=
"Preferences"
tab
=
"View"
>
<
tool
name
=
"ToggleScreenMode"
size
=
"medium"
shortcut
=
"F11"
/>
</
tools
>
<
tools
name
=
"Proofing"
tab
=
"Review"
>
<
tool
name
=
"AjaxSpellCheck"
size
=
"large"
/>
</
tools
>
</
root
>
I
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
root
>
<
modules
>
<
module
name
=
"RadEditorStatistics"
dockingZone
=
"Bottom"
/>
</
modules
>
<
tools
name
=
"Clipboard"
tab
=
"Home"
>
<
tool
name
=
"PasteStrip"
size
=
"large"
/>
<
tool
name
=
"Cut"
size
=
"medium"
/>
<
tool
name
=
"Copy"
size
=
"medium"
shortcut
=
"CTRL+C"
/>
<
tool
name
=
"Print"
size
=
"medium"
shortcut
=
"CTRL+P"
/>
</
tools
>
<
tools
name
=
"Editing"
tab
=
"Home"
>
<
tool
name
=
"Undo"
shortcut
=
"CTRL+Z"
/>
<
tool
name
=
"FindAndReplace"
shortcut
=
"CTRL+F"
/>
<
tool
name
=
"SelectAll"
shortcut
=
"CTRL+A"
/>
<
tool
name
=
"Redo"
shortcut
=
"CTRL+Y"
/>
</
tools
>
<
tools
name
=
"Content"
tab
=
"Insert"
>
<
tool
name
=
"InsertDate"
/>
<
tool
name
=
"InsertTime"
/>
</
tools
>
<
tools
name
=
"Zoom"
tab
=
"View"
>
<
tool
name
=
"Zoom"
/>
</
tools
>
<
tools
name
=
"Preferences"
tab
=
"View"
>
<
tool
name
=
"ToggleScreenMode"
size
=
"medium"
shortcut
=
"F11"
/>
</
tools
>
<
tools
name
=
"Proofing"
tab
=
"Review"
>
<
tool
name
=
"AjaxSpellCheck"
size
=
"large"
/>
</
tools
>
</
root
>
<
telerik:RadEditor
ID
=
"editorTemplate"
runat
=
"server"
ToolsFile
=
"EmailTemplateEditorTools.xml"
Height
=
"500px"
EditModes
=
"Design"
EditType
=
"Normal"
ToolbarMode
=
"RibbonBar"
SpellCheckSettings-AjaxUrl
=
"~/Telerik.Web.UI.SpellCheckHandler.ashx"
NewLineMode
=
"Br"
>
</
telerik:RadEditor
>
private string ConvertCrToBr(string stringToConvert)
{
// Count how many Char(10) occurances
// string needle = Convert.ToChar(10).ToString();
// int needleCount = (stringToConvert.Length - stringToConvert.Replace(needle, "").Length) / needle.Length;
string returnValue = stringToConvert.Replace(Convert.ToChar(10).ToString(), "<
br
/>");
return returnValue;
}
private string ScrubOutHtml(string stringToScrub)
{
var step1 = Regex.Replace(stringToScrub, @"<[^>]+>", "").Trim();
var step2 = Regex.Replace(step1, @" ", " ");
return step2;
}
Hi David,
Thank you for sharing your solution with the community!
I'd like to add also this demo on the matter Displaying RadEditor as a TextBox. It shows how to customize the appearance of the control so it looks similar to a textarea.
Another option is to force RadEditor to be rendered as a standard textarea by setting its EnableTextareaMode="true" property.
Best
Regards,
Rumen
Progress Telerik