Printing RichTextBox inside ListBox

2 posts, 0 answers
  1. Daní
    Daní avatar
    314 posts
    Member since:
    Feb 2008

    Posted 13 Dec 2010 Link to this post


    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.

  2. Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 16 Dec 2010 Link to this post

    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.

    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top