Can I use the RichTextEditor to show some XML?

2 Answers 116 Views
RichTextEditor
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Ian asked on 07 Mar 2023, 10:47 AM

I need to show the user some XML, but formatted nicely (identing, colors etc).

Can I use RichTextEditor for this? If so how (vb.net please!).

I don't need to edit the XML now, but I will need to in future (hence not using a Browser-type control)

Thanks

 

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Mar 2023, 10:51 AM

Hi, Ian,

RadSyntaxEditor is the appropriate control for loading XML content and formatting it properly. It is necessary to add the XmlTagger since it is responsible for the syntax-highlighting in the XML programming language. Additional information how to add taggers is available here: 

https://docs.telerik.com/devtools/winforms/controls/syntax-editor/features/taggers/overview

I would also recommend you to have a look at our Demo application >> SyntaxEditor examples which are quite useful on this topic. I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
answered on 07 Mar 2023, 02:49 PM

Prefect - just choosing the XmlTagger as a currentLanguageEditor, as per your example, makes the XML look really good.

Thanks

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 06 Apr 2023, 08:30 AM

This is still a great solution to viewing XML.

It would be even better if I could split the individual tags up a bit.

So for example:

<formatOption elementType="Component" stereotype="connected" attributeName="Alias" sort="1" title="ref" .....

would  look like:

<formatOption

elementType="Component" stereotype="connected" attributeName="Alias" sort="1" title="ref" 

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 06 Apr 2023, 08:30 AM | edited

This is still a great solution to viewing XML.

It would be even better if I could split the individual tags up a bit.

So for example:

<formatOption elementType="Component" stereotype="connected" attributeName="Alias" sort="1" title="ref" .....

would  look like:

<formatOption

   elementType="Component"

   stereotype="connected"

     attributeName="Alias"

(etc)

This is only because my lines are quite long, and a little bit hard to see.

Is this possible? Please :-)

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 06 Apr 2023, 02:13 PM

Hi, Ian,

As of R1 2023, the RadSyntaxEditor control supports word wrapping which enables users to view all text for a line that normally would have gone outside the viewport horizontally. It is just necessary to set the IsWordWrapEnabled property to true. Additional information is available here: https://docs.telerik.com/devtools/winforms/controls/syntax-editor/features/word-wrap 

Could you please share whether this approach would be suitable for you? 

Tags
RichTextEditor
Asked by
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Share this question
or