Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabinding lost when printing data-bound FlowDocument
    primarykey
    data
    text
    <p>I'm losing data-bind when initiating a printing process, is that possible ? Thats what I can only think of in my situation here, where I have a Table inside a control that makes the Table data-bindable, all inside a <code>FlowDocument</code>. When running it the data-bind works fine and the table draws itself with some data on it with no problems.</p> <p>However, when printing the output of that control is always blank.</p> <p>I've added a <code>ListView</code> with the same bindings and when printing the generated data it too appears lost.</p> <p>XAML:</p> <pre><code>&lt;Window x:Class="GlassStore.InitBill" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:GlassStore.ViewModels" xmlns:flowdocs="clr-namespace:FlowDocuments;assembly=FlowDocument" Title="InitBill" Height="825" Width="1004"&gt; &lt;Window.DataContext&gt; &lt;local:InitBillViewModel/&gt; &lt;/Window.DataContext&gt; &lt;Grid Background="White"&gt; &lt;FlowDocumentReader HorizontalAlignment="Center" HorizontalContentAlignment="Center"&gt; &lt;FlowDocument ColumnWidth="999999" IsColumnWidthFlexible="True" TextAlignment="Center" Name="FD"&gt; &lt;Paragraph&gt; &lt;ListView ItemsSource="{Binding GridTrans}"&gt; &lt;ListView.View&gt; &lt;GridView&gt; &lt;GridViewColumn Header="ffff" DisplayMemberBinding="{Binding CarModel}" /&gt; &lt;GridViewColumn Header="xxxx" DisplayMemberBinding="{Binding CarName}" /&gt; &lt;/GridView&gt; &lt;/ListView.View&gt; &lt;/ListView&gt; &lt;/Paragraph&gt; &lt;Paragraph TextAlignment="Center"&gt; &lt;TextBlock Text="{Binding test}" /&gt; &lt;/Paragraph&gt; &lt;flowdocs:ItemsContent ItemsSource="{Binding GridTrans}" Background="#FFF2C3C3" BorderThickness="2"&gt; &lt;flowdocs:ItemsContent.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;flowdocs:Fragment&gt; &lt;Table&gt; &lt;TableRowGroup flowdocs:Attached.IsItemsHost="True"&gt; &lt;TableRow Background="AliceBlue" &gt; &lt;TableCell Foreground="Red"&gt; &lt;Paragraph&gt; &lt;flowdocs:BindableRun BoundText="{Binding CarName}" /&gt; &lt;/Paragraph&gt; &lt;/TableCell&gt; &lt;TableCell Foreground="Green"&gt; &lt;Paragraph&gt; &lt;flowdocs:BindableRun BoundText="{Binding CarModel}" /&gt; &lt;/Paragraph&gt; &lt;/TableCell&gt; &lt;TableCell Foreground="Yellow"&gt; &lt;Paragraph&gt; &lt;flowdocs:BindableRun BoundText="{Binding glassPrice}" /&gt; &lt;/Paragraph&gt; &lt;/TableCell&gt; &lt;/TableRow&gt; &lt;/TableRowGroup&gt; &lt;/Table&gt; &lt;/flowdocs:Fragment&gt; &lt;/DataTemplate&gt; &lt;/flowdocs:ItemsContent.ItemTemplate&gt; &lt;/flowdocs:ItemsContent&gt; &lt;Table&gt; &lt;TableRowGroup&gt; &lt;TableRow&gt; &lt;TableCell&gt; &lt;Paragraph&gt;Row1 Cell1&lt;/Paragraph&gt; &lt;/TableCell&gt; &lt;TableCell&gt; &lt;Paragraph&gt;Row2 Cell2&lt;/Paragraph&gt; &lt;/TableCell&gt; &lt;/TableRow&gt; &lt;/TableRowGroup&gt; &lt;/Table&gt; &lt;/FlowDocument&gt; &lt;/FlowDocumentReader&gt; &lt;Button Command="{Binding print}" Content="إطـبع" Height="29" Margin="91,0,112,41" Name="button1" VerticalAlignment="Bottom" /&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>Now I know the problem is not with the Custom Control, because I have the same problem now with <code>ListView</code>.</p> <p>I've attached the source to the Window version <a href="https://skydrive.live.com/?cid=0010afd62dcf5eaa&amp;sc=photos#!/?cid=0010afd62dcf5eaa&amp;sc=photos&amp;id=10AFD62DCF5EAA!270" rel="nofollow">here</a> and the printed version <a href="https://skydrive.live.com/?cid=0010afd62dcf5eaa&amp;sc=photos#!/?cid=0010afd62dcf5eaa&amp;sc=photos&amp;id=10AFD62DCF5EAA!266!cid=0010AFD62DCF5EAA&amp;id=10AFD62DCF5EAA!269&amp;sc=photos" rel="nofollow">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload