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

ms word document text box not shown in RichTextEditor

8 Answers 166 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Salman
Top achievements
Rank 1
Salman asked on 18 Feb 2019, 12:38 PM
I have a word file with the docx extension; it is used in the file from the text box of the msword .
When I open the file by RichTextEditor, the text box controls are not displayed.

8 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 18 Feb 2019, 03:32 PM
Hi Salman,

Content controls are currently not supported in the RadRichTextEditor. We have a feature request logged on our feedback portal, here: https://feedback.telerik.com/winforms/1370689-add-radrichtexteditor-implement-support-for-content-controls. You can subscribe to it and be updarted when its status changes.

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.
0
Salman
Top achievements
Rank 1
answered on 19 Feb 2019, 05:42 AM
I want to put some text in the header of my document in an irregular manner, which seems to be done only through the textbox.
Is there a substitution method?
0
Salman
Top achievements
Rank 1
answered on 19 Feb 2019, 05:42 AM
I want to put some text in the header of my document in an irregular manner, which seems to be done only through the textbox.
Is there a substitution method?
0
Hristo
Telerik team
answered on 19 Feb 2019, 07:36 AM
Hi Salman,

The headers and footers are working with their own RadDocument. You can check the following documentation article with more details on how the headers and footers can be manipulated: https://docs.telerik.com/devtools/winforms/controls/richtexteditor/features/headers-and-footers.

Let me know if you have other questions.

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.
0
Salman
Top achievements
Rank 1
answered on 19 Feb 2019, 10:27 AM
Please see the attached image. As you can see, I want to write several texts in this way in my document. Apparently, there is no other way to do this except using the textbox.
0
Hristo
Telerik team
answered on 19 Feb 2019, 12:41 PM
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.
0
Salman
Top achievements
Rank 1
answered on 20 Feb 2019, 06:07 AM
thanks for your answer.
But, in my own word processor, I put a header that comes with the photo. With the code you wrote, it was deleted from my previous header containing the image. My word document is designed to have one or more images embedded in the header, and for some reason it should not be done through coding.
0
Hristo
Telerik team
answered on 20 Feb 2019, 08:32 AM
Hi Salman,

Currently, such a header cannot be achieved through the UI. Please subscribe to the feature request about the content controls feature so that you can be updated when the status of the item changes.

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.
Tags
RichTextEditor
Asked by
Salman
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Salman
Top achievements
Rank 1
Share this question
or