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

questions regarding richtextbox

1 Answer 69 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
loraine
Top achievements
Rank 1
loraine asked on 04 Jul 2011, 05:32 AM
hi,

i have two problems regarding the richtextbox:

1.) I set the header of the raddocument. The header contains a table. The table width cannot be increase and I noticed that the table width cannot exceed 6.5 inches. I think it's a bug.
2.) I am exporting a gridview as a word document. When I export it using the RtfFormatProvider(.doc extension), the headers and footers will not be included but I can set the column widths of every column equal. When I export it using the DocxFormatProvider(.docx extension), the headers and footers is included but the column widths are not equal.

Can you help me solve my problems? Thank you :)

Regards,
Loraine

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 07 Jul 2011, 08:18 AM
Hi Loraine,

Thank you for reporting these issues. As this was a Beta release, some features regarding the headers and footers were not entirely implemented. This applies to the table width in the headers and footers, the use of the UI with headers and footers and the export to RTF. Hopefully, we will manage to squeeze them in the official release some time next week or soon after that.
You can change the table width to a higher or lower value using the PreferredWidth property of the table, as illustrated below:

private void AddTableInHeader(Table table)
{
    Section firstSection = this.radRichTextBox1.Document.Sections.First;
    float tableWidth = this.radRichTextBox1.Document.DefaultPageLayoutSettings.Width - firstSection.ActualPageMargin.Horizontal;
    table.PreferredWidth = new TableWidthUnit(tableWidth);
 
    Header header = new Header();
    header.Body = new RadDocument();
    Section section = new Section();
    section.Children.Add(new Paragraph());
    section.Children.Add(table);
    header.Body.Sections.Add(section);
    this.radRichTextBox1.HeaderFooterUIContext.UpdateHeader(firstSection, HeaderFooterType.Default, header);
}

With regard to the width of the columns when the document is viewed in the editor and in Word after export to DOCX, they are different because the algorithm that RadRichTextBox uses to calculate the AutoFit columns' width it is different from that of Word. If the table columns' width is Fixed, this issue should not be present.

Greetings,
Iva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

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