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

Problem with InlineUIContainer

3 Answers 135 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Matt1234
Top achievements
Rank 1
Matt1234 asked on 15 Feb 2011, 10:34 PM
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>

3 Answers, 1 is accepted

Sort by
0
Matt1234
Top achievements
Rank 1
answered on 16 Feb 2011, 03:42 PM
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?
0
Accepted
Iva Toteva
Telerik team
answered on 18 Feb 2011, 04:40 PM
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.
0
Matt1234
Top achievements
Rank 1
answered on 18 Feb 2011, 07:58 PM
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).
Tags
RichTextBox
Asked by
Matt1234
Top achievements
Rank 1
Answers by
Matt1234
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or