Change Page Number Font Settings in Header

7 posts, 0 answers
  1. Will
    Will avatar
    2 posts
    Member since:
    Sep 2011

    Posted 12 Sep 2011 Link to this post

    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);
  2. Will
    Will avatar
    2 posts
    Member since:
    Sep 2011

    Posted 13 Sep 2011 Link to this post

    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?
  3. DevCraft banner
  4. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 15 Sep 2011 Link to this post

    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 >>

  5. Mike
    Mike avatar
    8 posts
    Member since:
    Dec 2011

    Posted 05 Apr 2012 Link to this post

    Is this still an issue?
  6. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 09 Apr 2012 Link to this post

    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 >>

  7. Edward
    Edward  avatar
    32 posts
    Member since:
    Jan 2008

    Posted 01 Aug 2012 Link to this post

    I have a span in front of the field and the font size is not the same.
  8. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 02 Aug 2012 Link to this post

    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.

Back to Top
DevCraft banner