Problem with InlineUIContainer

4 posts, 1 answers
  1. Matt1234
    Matt1234 avatar
    13 posts
    Member since:
    Nov 2009

    Posted 15 Feb 2011 Link to this post

    Hello everybody, 

    I'm trying to use a RadDocument to print some form data. To integrate the form XAML into the RadDocument, I'm wrapping it into an InlineUIContainer. Unfortuately, it only seems to work if I wrap a single XAML element ( the "test test test" textblock, section2). The grid in section1 and its contents are not shown. 

    Does anybody know how to make this work?

    <telerik:RadRichTextBox IsReadOnly="True" >
            <telerik:RadDocument>
               <telerik:RadDocument.Sections>
                    <telerik:Section x:Name="section1">
                        <telerik:Paragraph>                       
                            <telerik:InlineUIContainer >
                                 
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                     
                                    <TextBlock Grid.Row="0" Text="ID" />
                                    <TextBlock Grid.Row="1" Text="1" />
                                </Grid>                       
     
                            </telerik:InlineUIContainer>                       
                        </telerik:Paragraph>
                         
                    </telerik:Section>
                    <telerik:Section x:Name="section2">
                        <telerik:Paragraph>
                            <telerik:InlineUIContainer>
                                <TextBlock Text="Test Test Test" />
                            </telerik:InlineUIContainer>
                        </telerik:Paragraph>
                    </telerik:Section>
               </telerik:RadDocument.Sections>
            </telerik:RadDocument>
        </telerik:RadRichTextBox>
  2. Matt1234
    Matt1234 avatar
    13 posts
    Member since:
    Nov 2009

    Posted 16 Feb 2011 Link to this post

    I've also tried to put all controls into a UserControl and then pu this UserControl into an InlineUIContainer, but the RichTextBox doesn't show the UserControl, either.

    Is this a general Limitation of Richtextbox / RadDocument / InlineUIContainer or am I doing something wrong here?
  3. Answer
    Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 18 Feb 2011 Link to this post

    Hello Matthias,

    In order to utilize the InlineUIContainer, you have to set its Height and Width explicitly (or use the constructor that takes a Size as second parameter). Otherwise, they will not be shown in the document. You can, however, assign the width and the height of the inline UI container programmatically when you know the height and width of the UI element you want to insert, so that it wraps properly.
    Also note that we do not support multiple sections in the document and your sections will be merged into one. Thus, naming the sections and trying to manipulate them at a later point in time will be unsuccessful.
    If you have other questions, do not hesitate to contact us again.

    All the best,
    Iva
    the Telerik team
    In order to utilize the InlineUIContainer, you have to set its Height and Width explicitly (or use the constructor that takes a Size as a parameter). Otherwise, they will not be shown in the document.
    In order to utilize the InlineUIContainer, you have to set its Height and Width explicitly (or use the constructor that takes a Size as a parameter). Otherwise, they will not be shown in the document.
  4. Matt1234
    Matt1234 avatar
    13 posts
    Member since:
    Nov 2009

    Posted 18 Feb 2011 Link to this post

    Thank you for the answer.
    Unfortunately, that makes it rather unpractical to use the RadDocument as a container for printing and exporting form data (by integrating the controls and using data binding).
Back to Top