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

InlineUIContainer in header throwing exception Element Is Already The Child of Another Element exception

1 Answer 38 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 09 Nov 2011, 04:58 PM
I have a RadDocument defined in my App resources for use as a standard 
document header. I wanted to put a logo in the form of a geometry path in
 the document header so I went about it with an InlineUIContainer. However 
when the document is more than one page it throws an exception due to 
"Element is already the child of another element".

Is this a known issue? Is there a work around?

<telerik:RadDocument DefaultPageLayoutSettings="816,1056" LayoutMode="Flow" PageViewMargin="10,10" SectionDefaultPageMargin="95,95,95,95" x:Key="DocumentHeader">
			<telerik:Section PageMargin="95,95,95,95">
				<telerik:Table Background="#00000000" Borders="1,Single,#FF000000" CellSpacing="0" GridColumnWidthsSerializationInfo="Fixed,75.8119;Fixed,339.5257;Fixed,89.17736;Fixed,123.4555" LayoutMode="AutoFit" PreferredWidth="Auto" TableIndent="0">
					<telerik:TableRow Height="55">
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="2">
							<telerik:Paragraph>
								<telerik:InlineUIContainer >
									<Path Height="60" Width="60" Stretch="Uniform" Margin="3" StrokeThickness="0" Fill="Black" Data="..."  />
								</telerik:InlineUIContainer>
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,None,#FF000000;1,Inherit,#FF000000;1,Inherit,#FF000000;1,Inherit,#FF000000" ColumnSpan="1" RowSpan="2" VerticalAlignment="Center">
							<telerik:Paragraph SpacingAfter="0">
								<telerik:Span FontFamily="Verdana" FontSize="16" Text="Rowan Management System" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
							<telerik:Paragraph SpacingBefore="0">
								<telerik:Span FontFamily="Verdana" FontSize="16" Text="Management System Manual" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="Policy" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="&lt;&lt;POLICY&gt;&gt;" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
					</telerik:TableRow>
					<telerik:TableRow>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="Issue Date" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="&lt;&lt;ISSUED&gt;" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
					</telerik:TableRow>
					<telerik:TableRow>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="2" RowSpan="3" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="16" Text="&lt;&lt;TITLE&gt;&gt;" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="Revised" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="&lt;&lt;REVIESED&gt;&gt;" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
					</telerik:TableRow>
					<telerik:TableRow>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="Originator" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="&lt;&lt;ORIGINATOR&gt;&gt;" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
					</telerik:TableRow>
					<telerik:TableRow>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="Approved" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
						<telerik:TableCell Background="#00000000" Borders="1,Inherit,#FF000000" ColumnSpan="1" RowSpan="1" TextAlignment="Center" VerticalAlignment="Center">
							<telerik:Paragraph>
								<telerik:Span FontFamily="Verdana" FontSize="10.67" Text="&lt;&lt;APPROVED&gt;&gt;" UnderlineColor="#FF000000" UnderlineDecoration="None" />
							</telerik:Paragraph>
						</telerik:TableCell>
					</telerik:TableRow>
				</telerik:Table>
			</telerik:Section>
		</telerik:RadDocument>

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 09 Nov 2011, 08:01 PM
Hi Adam,

It is not possible to have InlineUIContainers in the headers and footers of the document.
RadRichTextBox uses copies of the document defined for the header in order to show the same content on every page. The UI elements embedded in InlineUIContainers cannot be cloned and that is the reason why the exception is thrown. I would suggest that you use an image instead of the Path embedded in an InlineUIContainer.

Regards,
Iva Toteva
the Telerik team

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

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