The RichTextBox print toolbar button only prints the content of the RichTextBox editor with the following javascript -
RTB_Print(RichTextBox1_x5,RTB_HtmlMode_RichTextBox1());
function RTB_Print(editor,htmlmode)
{
editor.document.execCommand('print','',null);
}
If you wish to print selective content from the RichTextBox and other Text elements when the Print Toolbar button is clicked you’ll need to override the existing print button (example code below) and then add some javascript that opens a new IFrame and writes the content that you want to print from your own Html Text elements and the RichTextBox and then prints this.
See the thread at http://www.experts-exchange.com/Web/Q_20862959.html for an example of creating the new frame and printing.
Code to override existing Print button onclick function call -
protected RichTextBoxControl.ToolbarButton toolButton;
private void Page_Load(object sender, System.EventArgs e)
{
toolButton = new RichTextBoxControl.ToolbarButton("Print", true);
toolButton.ClientOnClickFunction = "myButtonHandler";
this.RichTextBox1.CreateToolbarButton(toolButton);
}
Then javascript function in page -
<script language=javascript type=text/javascript>s
function myButtonHandler(editor, isHtmlMode)
{
alert('print');
//add your own print logic here
}
</script>