Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
750
WinGrid export to PDF
posted

Is it possible to change the way the grid looks when it's exported to PDF?

I have a small grid that I'm putting below a chart (see attached) and I would like to make the grid LOOK better.  Maybe just centering the rows vertically would be enough.  The grid looks find in the UI.

Is there some magic setting somewhere?

thanks,

Gene

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Gene,

    Oh, I see. I was confused when you said "centering the rows vertically". It sounds like what you meant was centering the text in the row, not the row itself. 

    The alignement of the text in the PDF is the same as the alignement of the text in the grid layout being exported. So if you want to make any changes like this, the best place to do it would be in the events of the exporter. The BeginExport event will pass you a clone of the grid's layout. The great part about this is that it's a clone, so you can modify it any way you like and it will affect the export and not the on-screen grid. So you could, for example, do something like this: 

    e.Layout.Override.CellAppearance.TextVAlign = TextVAlign.Middle;

    You can also use the InitializeRow event on the exporter. Once again, the rows in this event are clones of the real grid rows, so you can apply appearances to them without afftecting the on-screen grid. 

Children
No Data