This is a migrated thread and some comments may be shown as answers.

Printing RichTextBox inside ListBox

1 Answer 103 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 13 Dec 2010, 05:37 PM
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

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 16 Dec 2010, 01:59 PM
Hello DanĂ­,

Can you send us a sample project or some more information on your implementation and the "failing"? Are you getting some sort of exception? If you are creating the documents and rich text boxes in code-behind, they might need to be measured and arranged before proceeding.
Some more information on your printing implementation can also be helpful for identifying the reasons for the misbehavior.
Looking forward to your reply.

Regards,
Iva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
RichTextBox
Asked by
Daní
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or