Issue with Import method XamlFormatProvider

2 posts, 0 answers
  1. Tobania
    Tobania avatar
    160 posts
    Member since:
    Apr 2010

    Posted 31 Mar 2011 Link to this post


    I'm using the XamlFormatProvider to convert a string value to a RadDocument object. This RadDocument object is used to populate the RadRichTextBox. The string value is in fact a string representation of a RadDocument object and its content.

    I notice an issue when the RadDocument contains a (bulleted) list. The string representation of that RadDocument contains several ListSerializationData tags, which have a specific ListID. The issue is that the XamlFormatProvider modifies the ListID while converting the string into a RadDocument object. (via the Import method of the XamlFormatProvider)

    This is annoying because the application I'm developing contains functionality to detect if the rich text has been changed. As a result, when the user opens the page that contains a RichTextBox with a bulleted list in its content, the GUI indicates that the content of the RichTextBox has been changed, while the user did not change anything at all.

    So is there a way to prevent the XamlFormatProvider from changing the ListID's while converting a string to a RadDocument object?

  2. Ivailo Karamanolev
    Ivailo Karamanolev avatar
    276 posts

    Posted 01 Apr 2011 Link to this post

    Hello Sodi We,

    Currently, the list IDs are exported as they are in the document. They are assigned by a static counter variable which unfortunately, makes the document different on every export. What you can do is build a relatively simple regex to match the IDs as they appear in the XAML and replace them with an empty string. This will make the document invariant regarding those IDs.
    However, your suggestion is very good and we have added some Telerik points to your account. For the service pack however, we will do our best to change the behavior and export sequential IDs starting from 1.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top