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

Custom text formatter

2 Answers 59 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 01 Dec 2010, 11:34 AM
Hello,

I have to import text from a legacy system with a custom format. This format codes break lines as a row of 21 blank spaces. How can I format this text to see the break lines in RichtTextBox?

2 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 02 Dec 2010, 10:49 AM
Hi DanĂ­,

You basically have 2 options.
  1. Use string.Replace to replace occurrences of 21 blank spaces with "\r\n" sequences and then use the TxtFormatProvider. Probably this will be easier, but will only work if you don't require any styling to be applied based on some custom format.
  2. Parse the string from the legacy system and create a RadDocument and a Section with Paragraphs, Spans with your own code. This will require some greater effort, but will give you the option to parse not only basic line breaks, but any additional information contained in the string being imported.
Get back to us if you experience any issues.
All the best,
Ivailo
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Daní
Top achievements
Rank 1
answered on 02 Dec 2010, 11:23 AM
Thnanks it runs, at least the first solution that I already tried with ("/r/n"), I forgot i had to use back slashes.

Best regards!!!
Tags
RichTextBox
Asked by
Daní
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Daní
Top achievements
Rank 1
Share this question
or