No padding when printing cells with HTMLRendering

3 posts, 1 answers
  1. Andreas Haeusler
    Andreas Haeusler avatar
    25 posts
    Member since:
    Nov 2009

    Posted 24 May 2016 Link to this post

    Hello,

     

    if I print cells with HTMLRendering the text aligns to the top left of the cell and something equivalent to padding 0;0;0;0 is used. How do you fix that?

     

    private void BestFitRadGridView_PrintCellFormatting(object sender, PrintCellFormattingEventArgs e)
           {
               e.PrintCell.Font = new Font(e.PrintCell.Font.FontFamily, 7F);
               e.PrintCell.EnableHtmlTextRendering = !e.Column.DisableHTMLRendering;
               e.PrintCell.TextPadding = new Padding(5);
             
           }

    If i set EnableHtmlTextRendering = false the padding (set in the printstyle or on cell-level) is used as expected.

     

     

    Kind regards,

    Andreas

  2. Answer
    Hristo
    Admin
    Hristo avatar
    767 posts

    Posted 25 May 2016 Link to this post

    Hi Andreas,

    Thank you for writing.

    The observed behavior is an issue withing the printing engine of the grid. That is why I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item. I have also updated your Telerik Points.

    The item is already in development and a permanent fix will be available with our next official release.

    For the time being please use the workaround solution in the attached project. Basically, you would need to create custom renderer and print cells and then adjust the painting rectangle of the cell depending on the text padding.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
  3. Andreas Haeusler
    Andreas Haeusler avatar
    25 posts
    Member since:
    Nov 2009

    Posted 25 May 2016 in reply to Hristo Link to this post

    Hello Hristo,

     

    your fix works perfectly. Thank you very much.

     

    Kind regards,

    Andreas

Back to Top