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

Error loading Xaml using XamlFormatProvider

3 Answers 176 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 19 Aug 2010, 04:57 PM
I'm getting this error when trying to load xaml:
Cannot add inline, which does not have at least one position.

Here is the xaml it is trying to load:

<t:RadDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:t="clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents" version="1.0" LayoutMode="Paged" PageViewMargin="10,10" DefaultPageLayoutSettings="800,1140" ParagraphDefaultSpacingAfter="10" SectionDefaultPageMargin="95,95,95,95">
  <t:Section PageMargin="95,95,95,95">
    <t:Paragraph SpacingAfter="0">
      <t:Span Text="Home Base" FontFamily="Verdana" />
    </t:Paragraph>
    <t:Paragraph SpacingAfter="0">
      <t:Span Text="6037 Finanical Drive" FontFamily="Verdana" />
    </t:Paragraph>
    <t:Paragraph SpacingAfter="0" />
    <t:Paragraph SpacingAfter="0">
      <t:Span Text="hello" FontFamily="Verdana" />
    </t:Paragraph>
    <t:Paragraph SpacingAfter="0" />
    <t:Paragraph SpacingAfter="0">
      <t:Span Text="" FontFamily="Verdana" />
    </t:Paragraph>
  </t:Section>
</t:RadDocument>

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 23 Aug 2010, 03:42 PM
Hello Kevin,

Adding Span elements with empty text is currently not supported. If you remove the last span definition from your Xaml all should work fine. In general RadRichTextBox should not allow you to save documents with empty Span elements. Please let us know if you added this empty span element manually or if RadRichTextBox somehow generated it?

Greetings,
Mike
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
0
Kevin
Top achievements
Rank 1
answered on 23 Aug 2010, 03:57 PM
Thanks.  I figured it out soon after I asked.  I'm doing some replacing of text based on what the user inserts.
0
Ivailo Karamanolev
Telerik team
answered on 24 Aug 2010, 07:59 AM
Hello Kevin,

As a workaround until empty spans are support, you can try parsing the XAML (as it is valid XML) and strip the empty Spans. Let us know how it goes.

Best wishes,
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
Kevin
Top achievements
Rank 1
Answers by
Mike
Telerik team
Kevin
Top achievements
Rank 1
Ivailo Karamanolev
Telerik team
Share this question
or