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

Editing XAML document file in visual designer.

1 Answer 59 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 04 Apr 2012, 12:05 PM
I have a simple document i will be using as a test to load into a radrichtext control and then print it.

I would like to be able to edit it using some kind of visual tool. But when i try to load it into visual studio it tells me that the root is not supported. This is what my file looks like:
<telerik:RadDocument
    xmlns:telerik="clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents" 
    DefaultPageLayoutSettings="793,1123"
    LayoutMode="Flow"
    PageViewMargin="10,10"
    ParagraphDefaultSpacingAfter="10"
    SectionDefaultPageMargin="95,95,95,95">
    <telerik:Section PageMargin="10,10,10,10">
        <telerik:Table LayoutMode="AutoFit"  >
            <telerik:TableRow>
                <telerik:TableCell>
                    <telerik:Paragraph>
                        <telerik:Span Text="Cell 1" />
                    </telerik:Paragraph>
                </telerik:TableCell>
                <telerik:TableCell>
                    <telerik:Paragraph>
                        <telerik:Span Text="Cell 2" />
                    </telerik:Paragraph>
                </telerik:TableCell>
            </telerik:TableRow>
            <telerik:TableRow>
                <telerik:TableCell ColumnSpan="2">
                    <telerik:Paragraph>
                        <telerik:Span Text="Cell 3" />
                    </telerik:Paragraph>
                </telerik:TableCell>
            </telerik:TableRow>
            <telerik:TableRow>
                <telerik:TableCell RowSpan="2">
                    <telerik:Paragraph>
                        <telerik:Span Text="Cell 4" />
                    </telerik:Paragraph>
                </telerik:TableCell>
                <telerik:TableCell>
                    <telerik:Paragraph>
                        <telerik:Span Text="Cell 5" />
                    </telerik:Paragraph>
                </telerik:TableCell>
            </telerik:TableRow>
            <telerik:TableRow>
                <telerik:TableCell>
                    <telerik:Paragraph>
                        <telerik:Span Text="Cell 6" />
                    </telerik:Paragraph>
                </telerik:TableCell>
            </telerik:TableRow>
        </telerik:Table>
    </telerik:Section>
</telerik:RadDocument>

I kind of based it on one of the sample files called, RadRichTextBoxOverview.xaml , just much simpler.

Is there a way i can edit it without well, constantly printing it to see what it actually looks like?

1 Answer, 1 is accepted

Sort by
0
Accepted
Iva Toteva
Telerik team
answered on 05 Apr 2012, 02:02 PM
Hi Andrew,

The easiest way to create a XAML document for RadRichTextBox that would be declared in the xaml page is to create the document in the editor using the UI - RadRichTextBoxRibbonUI, the default dialogs for customizing the properties of the paragraphs and tables, etc. After that, export the document to XAML, strip the unnecessary properties and add the document to the content of RadRichTextBox in the XAML of the page in Visual Studio.

You should be able to see the way the document looks in the designer.

Please find attached a screenshot of how the designer shows the document you have included as a code snippet.
I hope this is what you are looking for.

Greetings,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Andrew
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or