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

Best Way to add TEXT to RadEditor

3 Answers 146 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Virendra Shinde
Top achievements
Rank 1
Virendra Shinde asked on 06 Apr 2010, 06:20 AM
I am trying to add TEXT with newline and spaces to the radEditor using VB.NET using the radEditor.Content property. But it seems to loose all the formatting made in the TEXT string.

Also I would like to know what method is recommended to call editor.set_html in VB.net. I guess that will solve my problem of formatting.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 06 Apr 2010, 08:12 AM
Hello Virendra,

The /r and /n symbols used in the textboxes to render new lines and spaces and new lines are not recognized by the web editors which work with HTML content only. For that reason you should replace the /r/n symbols with <br/> tags before loading them through the Content property of RadEditor. The empty spaces should be replaced by &nbsp; entities as well. You can do that using the String.Replace method.


Best regards,
Rumen
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.
0
Virendra Shinde
Top achievements
Rank 1
answered on 06 Apr 2010, 04:02 PM
OK I can do that. But how can I disable all the Rad Editor buttons and make it just like a TEXTbox similar to how the HTML mode looks then ?
0
Rumen
Telerik team
answered on 06 Apr 2010, 04:05 PM
Hi Virendra,

You can hide the toolbar by setting the following css class on the page with RadEditor:

<style type="text/css">
.reToolCell, .reLeftVerticalSide, .reRightVerticalSide { display:none; }
</style>

You can see how to hide the modules in this article: Disable or Hide Modules.

You can hide the edit mode buttons by setting EditModes="Design".

Sincerely yours,
Rumen
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
Virendra Shinde
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Virendra Shinde
Top achievements
Rank 1
Share this question
or