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

Issue with Import method XamlFormatProvider

1 Answer 54 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Tobania
Top achievements
Rank 1
Tobania asked on 31 Mar 2011, 03:27 PM

Hello,

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?

Thanks
Sodi

1 Answer, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 01 Apr 2011, 05:17 PM
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,
Ivailo
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
Tags
RichTextBox
Asked by
Tobania
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Share this question
or