Editing XAML document file in visual designer.

2 posts, 1 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 04 Apr 2012 Link to this post

    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?

  2. Answer
    Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 05 Apr 2012 Link to this post

    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 >>

  3. DevCraft banner
Back to Top