Hello,
I'm using RichTextBox control inside a DataTemplate used as the ItemTemplate of a ListBox in read only mode. I'd like to allow users print the entire ListBox's items I don't know how to achieve it. Of course, the ListBox can need multiple pages so I've done custom printing. What I've done is create an UserControl (PrintRichTextBox) that contains a RichTextBox, this UserControl has a method, SetDocument(RadDocument document) that provides de RadDoument for the RichTextBoxControl. On PrintPage's PrintDocument event handler, I'm creating an StackPanel and I'm adding PrintRichTextBox control instances until print page height is reached. I don't know why, but printing always fails (I'm printing with XPS virtual printer), if replacing RichTextBox by a TextBlock everything run ok.
Thanks
I'm using RichTextBox control inside a DataTemplate used as the ItemTemplate of a ListBox in read only mode. I'd like to allow users print the entire ListBox's items I don't know how to achieve it. Of course, the ListBox can need multiple pages so I've done custom printing. What I've done is create an UserControl (PrintRichTextBox) that contains a RichTextBox, this UserControl has a method, SetDocument(RadDocument document) that provides de RadDoument for the RichTextBoxControl. On PrintPage's PrintDocument event handler, I'm creating an StackPanel and I'm adding PrintRichTextBox control instances until print page height is reached. I don't know why, but printing always fails (I'm printing with XPS virtual printer), if replacing RichTextBox by a TextBlock everything run ok.
Thanks