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

Displaying XML Contents in a RadEditor

4 Answers 398 Views
Editor
This is a migrated thread and some comments may be shown as answers.
A2H
Top achievements
Rank 1
A2H asked on 01 Mar 2012, 04:35 PM
Hi,

I have an application which  has the following functionality.
Uploading an XML file through  RadUpload and displaying the XML Content in a RadEditor.

Problem

I am able to show the content in RadEditor ,but the XML tags and styling is gone :( I need the exact XML with its original structure to be shown in Rad Editor(Refer Attached Image)

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Mar 2012, 12:27 PM
Hello,

RadEditor does not offers code highlighting for XML tags and the suggested approach is to insert your content through the provided Format Code Block dialog.

The RadControls Quick Start Framework also 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 folder of the demo application (C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q2 2011\Live Demos\App_Code\QuickStart\CodeViewerHelper.cs)

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("Default.aspx.vb"));

The RenderFile method could read XML, ASPX, C# and VB.NET content.


Greetings,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Vyas
Top achievements
Rank 1
answered on 09 Mar 2012, 03:24 PM
Hi Rumen,

Thanks for the resolution provided for my issue.

It worked till one extent.

I followed the same procedure and the key word highlighting is found. But the indentation is not working. Even not all the keywords are highlighted.

Can you help me on this.

Can we make the rad editor work exactly the same as the Visual Studio window.

Regards,
Vyas
0
Rumen
Telerik team
answered on 14 Mar 2012, 09:45 AM
Hi,

I tested the reported behavior and verified that the indentation is rendered as expected as you can see in the following video: http://screencast.com/t/uorKrcFT6v. If you would like to add additional highlighting for additional special words, you can try to modify and enhance the \App_Code\QuickStart\CodeViewerHelper.cs class. We do not provide support for this functionality of the QSF system and it is out of the scope of our support.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Rumen
Telerik team
answered on 11 Sep 2020, 07:29 AM

Hi again,

The CodeViewerHelper.cs file location is changed in the new versions of the Telerik ASP.NET AJAX Demo app.

The new location is:

C:\Program Files (x86)\Progress\Telerik UI for ASP.NET AJAX R2 2020\Live Demos\App_Code\QSFCommon

 

Regards,
Rumen
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Editor
Asked by
A2H
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Vyas
Top achievements
Rank 1
Share this question
or