1 Solution
Hi,
You can customize PrintCellStyles (see How to use the PrintCellStyle property to customize cell's printing appearance) and add custom value converter to them in order to print different rows differently depending on the underlying data. Attached is a sample project and screencast that illustrates this approach in action. I hope this will help you.
Thanks,
Alessandro.
-
Thanks! With additional customization i've been able to fit this technic into my code.
But i've run into the problem with export. Using this cell style i get 2 empty columns after each filled column and 2 empty rows after each filled row! If i don't use this cell style - all works fine:
<Style x:Key="CellPrintingStyle" TargetType="dxe:TextEdit"
BasedOn="{StaticResource {dxgt:TableViewThemeKey ResourceKey=DefaultPrintCellStyle}}">
<Style.Setters>
<Setter Property="dxp:ExportSettings.TargetType" Value="Panel" />
<Setter Property="DisplayTemplate">
<Setter.Value>
<ControlTemplate>
<dxe:TextEdit Text="{Binding Value}"
TextWrapping="Wrap"
IsPrintingMode="True"
Margin="4" FontWeight="{Binding Value, Converter={local:FontWeightConverter}}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Left"
/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>I think it's somehow related to TextEdit placement settings... I'll try to dig into it... anyway, do you have any ideas?
-
Yes! The margin was the cause of this behaviour. Thanks, all works fine now!
-
Thank you for your feedback.
I am glad to hear that the issue has been resolved. Please contact us if you experience any further difficulties.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.