-1

I made a control which shows some data within a DataGrid.
When used within a window, it works without issue.
When i write it to an Xps file, the header gets shifted and the output is wrong. To write it to an XPS, i create my control, then i fill in the data it needs to display.

I used this post : Convert WPF (XAML) Control to XPS Document to output the control to an Xps file.

I tried to have the HeaderRowTemplate to a fixed size with no result.

I also tried to update the layout after the data update with no result.

The Columns and rows are computed on-the-fly, depending on which data is non-null.

(Rq : vertical and horizontal properties are not the same)

Here's how looks the control with some data loaded within a window :

Right display, inside a window

And there's a screenshot of the xps file generated from this control.

ScreenShot of the xps generated

Edit : i finally found a workaround for this issue : i added a 'Print Preview' window in which the controls are shown -which user like anyway- and i 'print' this (correct) window content.

4

1 に答える 1