Custom text formatter

3 posts, 0 answers
  1. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 01 Dec 2010 Link to this post

    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. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 02 Dec 2010 Link to this post

    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
  3. DevCraft banner
  4. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 02 Dec 2010 Link to this post

    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!!!
Back to Top