Hi,
A similar header can be achieved programmatically by arranging TextBlock elements in floating UI containers:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
TextBlock textBlock =
new
TextBlock()
{
Text =
"Some Text"
,
FontSize = 16,
FontFamily =
new
Telerik.WinControls.RichTextEditor.UI.FontFamily(
"Calibri"
),
PositionOffset =
new
System.Drawing.SizeF(0, 20)
};
FloatingUIContainer uiContainer =
new
FloatingUIContainer(textBlock,
new
Telerik.WinControls.RichTextEditor.UI.Size(75, 25));
TextBlock textBlock2 =
new
TextBlock()
{
Text =
"Some Text 2"
,
FontSize = 16,
FontFamily =
new
Telerik.WinControls.RichTextEditor.UI.FontFamily(
"Calibri"
),
PositionOffset =
new
System.Drawing.SizeF(200, 0)
};
FloatingUIContainer uiContainer2 =
new
FloatingUIContainer(textBlock2,
new
Telerik.WinControls.RichTextEditor.UI.Size(75, 25));
TextBlock textBlock3 =
new
TextBlock()
{
Text =
"Some Text 3"
,
FontSize = 16,
FontFamily =
new
Telerik.WinControls.RichTextEditor.UI.FontFamily(
"Calibri"
),
PositionOffset =
new
System.Drawing.SizeF(400, -20)
};
FloatingUIContainer uiContainer3 =
new
FloatingUIContainer(textBlock3,
new
Telerik.WinControls.RichTextEditor.UI.Size(75, 25));
Paragraph paragraph =
new
Paragraph();
paragraph.Inlines.Add(uiContainer);
paragraph.Inlines.Add(uiContainer2);
paragraph.Inlines.Add(uiContainer3);
Section section =
new
Section();
section.Blocks.Add(paragraph);
RadDocument commentBody =
new
RadDocument();
commentBody.Sections.Add(section);
Header header =
new
Header() { Body = commentBody, IsLinkedToPrevious =
false
};
this
.radRichTextEditor1.UpdateHeader(
this
.radRichTextEditor1.Document.Sections.First, HeaderFooterType.Default, header);
}
Please note that this header only consists of UI elements and these elements will not be persisted in the document if it later exported, e.g. to Word.
I am also attaching a screenshot showing the result on my end. I hope this will help.
Regards,
Hristo
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.