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

Is it possible to add color coding to the HTML tags in the Editor?

3 Answers 79 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 20 Jan 2009, 09:15 PM
Does anyone know if it is possible to enable some type of color coding of the HTML code in the editor.  Something that would help distinguish HTML elements from actual content.  Something like what is used by VS.NET and many other popular HTML editors.

Thanks!
-Mark

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 23 Jan 2009, 04:07 PM
Hi Mark,

RadEditor does not offer the requested feature out-of-the box and we do not plan to provide support for it for the time being.

Nevertheless, RadControls examples framework features such a tool for its C#/VB/ASPX tabs underneath each example. The tool is delivered as source code and is available in the App_Code\QuickStart of the demos application (C:\Program Files\telerik\RadControls for ASPNET AJAX Q2 2008\Live Demos\App_Code\QuickStart)

What you could do is add the QuickStart folder to your own application's App_Code, and then a single line of code will do the trick, e.g.

RadEditor1.Content = Telerik.QuickStart.CodeViewerHelper.RenderFile(Server.MapPath("Person.xml"));

Greetings,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark
Top achievements
Rank 1
answered on 23 Jan 2009, 04:37 PM
Rumen,

Thanks for the reply.  This is very helpful and almost solves what we'd like to accomplish.  we're loading the content from a database , and not from a file but i was able to modify the source code sample to accomplish that task, however we still want the content to load initally in design mode, and only call the CodeViewerHelper method when the user switches to HTML mode.  Is it possible for us to tie into some event being fired when the user switches to HTML mode?

Thanks!
-Mark
0
Tervel
Telerik team
answered on 26 Jan 2009, 05:07 PM
Hi Mark,

There is a RadEditor event (which was exposed as a server-side property in the latest Q3 SP2 2008 - build 2008.3.13.14) called OnClientModeChange.

You can use this event to detect editor mode change, but this alone will not be enough to achieve your goal. Please note that the editor's HTML area is a TEXTBOX element that is not able to display color-coded formatting.

In case you need to have the formatting color coded, you will need to show an editable IFRAME instead.
If you wish to go for this option, my suggestion is to implement this IFRAME solution (you can have the IFRAME somewhere on the page) and send it to us. Once we have a more or less working solution from you, we will add a couple of tweaks to have the IFRAME display instead of the default HTML TEXTAREA.

Best wishes,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Mark
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Mark
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or