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

Change Page Number Font Settings in Header

6 Answers 136 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Will
Top achievements
Rank 1
Will asked on 12 Sep 2011, 10:01 PM

Hello all,

Perhaps I'm just missing the obvious here, but I'm having trouble changing the font size of a PageField in my RadDocument's Header.  I can add a Span into the same Paragraph containing the PageField and change the styling of that, but I'm unable to change the style of the PageField itself.

Here's how I'm currently adding the PageNumbers to the Document.  Any help/suggestions would be great.  Thanks.

Header header = new Header();
RadDocument doc = new RadDocument();
Section sec = new Section();
Paragraph para = new Paragraph() { TextAlignment = Telerik.Windows.Documents.Layout.RadTextAlignment.Right };
 
FieldRangeStart fieldStart = new FieldRangeStart();
FieldRangeEnd fieldEnd = new FieldRangeEnd();
 
fieldEnd.PairWithStart(fieldStart);
fieldStart.Field = new PageField();
fieldStart.Field.DisplayMode = FieldDisplayMode.Result;
 
para.Children.Add(fieldStart);
para.Children.Add(fieldEnd);
sec.Children.Add(para);
doc.Sections.Add(sec);
header.Body = doc;
 
radRTB.HeaderFooterUIContext.UpdateHeader(radRTB.Document.Sections.First, HeaderFooterType.Default, header);

6 Answers, 1 is accepted

Sort by
0
Will
Top achievements
Rank 1
answered on 13 Sep 2011, 03:59 PM
Small update/clarification:

After some more digging around, I think that I need is to change the Fontsize of the Span that is returned as a ResultFragment from the FIeldRangeStart element.
I was able to dig down through the elements while debugging and saw that the default size of this span is 16 even though the Fontsize of the Paragraph that contains it is set to 12.

Is there a way to force the Paragraph's Inlines to adhere to it's settings?
0
Iva Toteva
Telerik team
answered on 15 Sep 2011, 04:38 PM
Hi Will,

At this point, there is no way to set the font settings of the PageField in the header. The Telerik points in your account have been updated in appreciation of your bug report and the detailed inspection you have carried out.
I am also creating a PITS issue, which you can use to track our progress on this item.
You can follow the PITS Issue by its ID: 7860
Here you can find the PITS Issue: Public URL 

Greetings,
Iva
the Telerik team

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

0
Mike
Top achievements
Rank 1
answered on 05 Apr 2012, 10:31 PM
Is this still an issue?
0
Ivailo Karamanolev
Telerik team
answered on 09 Apr 2012, 01:06 PM
Hi,

We have changed the behavior of fields with regard to styles: in the latest version, the style of the field is extracted from its result (or more specifically, the first Span of its contents). This style is persisted through the document and when exported/imported.
Changing the formatting of the field can be done both programmatically and from the UI. This should suit your case, but feel free to contact us if you have any comments.

Regards,
Ivailo Karamanolev
the Telerik team

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

0
Edward
Top achievements
Rank 1
answered on 01 Aug 2012, 06:42 PM
I have a span in front of the field and the font size is not the same.
0
Iva Toteva
Telerik team
answered on 02 Aug 2012, 08:44 AM
Hi Edward,

The Span that Ivailo mentions must be in the field range, between the FieldRangeStart and FieldRangeEnd element. You can refer to this forum thread for sample code how this can be achieved when creating the document in code-behind.

If you are adding the page field from the UI, it will take the current style of the document. You can test that in the online demo.

Regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Will
Top achievements
Rank 1
Answers by
Will
Top achievements
Rank 1
Iva Toteva
Telerik team
Mike
Top achievements
Rank 1
Ivailo Karamanolev
Telerik team
Edward
Top achievements
Rank 1
Share this question
or