Hi,
I am printing GridView's and TreeListViews using the PrintAndExportWithRadDocumentModel.cs code, which I found on the forum somewhere.
I need to be able to hide the PrintDialog if required, how do I achieve this using the printing functionality of the RichTextBox. Previously I was using another class PrintExtensions.cs, but this was not able to print the TreeListView's which I need.
Thanks,
Adam
I am printing GridView's and TreeListViews using the PrintAndExportWithRadDocumentModel.cs code, which I found on the forum somewhere.
public
void
Print(
object
parameter)
{
GridViewDataControl grid = (GridViewDataControl)parameter;
RadRichTextBox rtb =
new
RadRichTextBox() { Height = 0 };
rtb.Name =
"RadRichTextBox1"
;
Grid parent = grid.ParentOfType<Grid>();
if
(parent !=
null
&& parent.FindName(rtb.Name) ==
null
)
{
parent.Children.Add(rtb);
rtb.ApplyTemplate();
}
rtb.Dispatcher.BeginInvoke((Action)(() =>
{
rtb.Document = CreateDocument(grid);
}));
rtb.Print(
"MyDocument"
, Telerik.Windows.Documents.UI.PrintMode.Native);
}
I need to be able to hide the PrintDialog if required, how do I achieve this using the printing functionality of the RichTextBox. Previously I was using another class PrintExtensions.cs, but this was not able to print the TreeListView's which I need.
Thanks,
Adam