Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hello,

                                    I've defined a grid column header in the following way:

                                    [XAML]
                                    <dxg:GridColumn.Header> <Image Source="/Images/16x16/document.png" Stretch="None" /> </dxg:GridColumn.Header>
                                    The problem is, that it doesn't print the header (instead, it prints 'System.Byte[]') when printing or previewing the print.

                                    Also, I can't print a column that has its content defined via a converter. I've tried a ton of samples provided in the support center and documentation, but I can't print a column that's defined like that:
                                    [XAML]
                                    <dxg:GridColumn.CellTemplate> <DataTemplate DataType="dxg:CellValueEventArgs"> <Image Width="16" Height="16" Source="{Binding Path=Value, Converter={cv:ImageConverter}}" /> </DataTemplate> </dxg:GridColumn.CellTemplate>
                                    And the converter returns:
                                    [C#]
                                    return new Uri("/Images/16x16/mail-reply.png", UriKind.Relative);
                                    How can I solve that?

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi,

                                The Header and CellStyle properties are not applied in printing. For custom printing of the GridControl, it is necessary to use the PrintColumnHeaderStyle and PrintCellStyle properties.
                                Feel free to contact us if you need additional information.

                                Thanks

                                • Ryan Mills 05.20.2013

                                  Thanks for your answer! But this (for a static header) doesn't work:

                                                                              <dxg:GridColumn.PrintColumnHeaderStyle>
                                                                                   <Style TargetType="{x:Type Image}">
                                                                                       <Setter Property="Source" Value="/Images/16x16/document.png" />
                                                                                   </Style>
                                                                               </dxg:GridColumn.PrintColumnHeaderStyle>

                                  Can you please also show a sample for a CellStyle used for printing, that gets its value from a converteR?

                                • Dmitry Tok (DevExpress Support) 05.21.2013

                                  Hello Ryan,
                                  To print an image within the grid column header, I suggest you use the following PrintColumnHeaderStyle:

                                  [XAML]
                                  xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing" ... <dxg:GridColumn.PrintColumnHeaderStyle> <Style TargetType="dxe:TextEdit"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Image Source="..."/> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="dxp:ExportSettings.TargetType" Value="Image"/> </Style> </dxg:GridColumn.PrintColumnHeaderStyle>
                                  As for the question about the PrintCellStyle, I suggest you review the following articles:
                                  1) How to customize the DXGrid printing appearance;
                                  2) How to use the PrintCellStyle property to customize cell's printing appearance.
                                  Feel free to contact us if you need further clarification.
                                  Thanks

                                • Ryan Mills 05.21.2013

                                  Thanks, this has really helped me!

                                • Dmitry Tok (DevExpress Support) 05.21.2013

                                  You're welcome, Ryan!

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners