Skip to content

Commit a08c6de

Browse files
ES-975464 - Addressed the concerns
1 parent a50a455 commit a08c6de

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

PrintPreview.png

49.4 KB
Loading

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# How to print wpf treegrid with pdfviewercontrol
1+
# How to Print WPF TreeGrid with PdfViewerControl?
22

3-
This sample illustrates how to print [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) with [PdfViewerControl](https://help.syncfusion.com/wpf/pdf-viewer/printing-pdf-files).
3+
This sample illustrates how to print [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) (SfTreeGrid) with [PdfViewerControl](https://help.syncfusion.com/wpf/pdf-viewer/printing-pdf-files).
44

5-
## Default Printing
6-
7-
The printing feature can be achieved by exporting the `TreeGrid` to PDF and printing the exported PDF using the `PdfViewerControl`.
5+
The printing feature can be achieved by exporting the **TreeGrid** to PDF and printing the exported PDF using the **PdfViewerControl**.
86

97
``` c#
108
var options = new TreeGridPdfExportingOptions();
@@ -32,17 +30,17 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
3230
}
3331
```
3432

35-
## Custom Printing
33+
![Printing TreeGrid with PdfViewerControl](PrintPreview.png)
34+
35+
### Print Parent and Expanded Child Nodes:
3636

37-
You can print only the parent and expanded child nodes by overriding the `ExportNodesToPdf` method of the `TreeGridToPdfConverter` class.
37+
You can print only the parent and expanded child nodes by overriding the [ExportNodesToPdf](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.Converter.TreeGridToPdfConverter.html#Syncfusion_UI_Xaml_TreeGrid_Converter_TreeGridToPdfConverter_ExportNodesToPdf_Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_Syncfusion_UI_Xaml_TreeGrid_TreeNodes_Syncfusion_Pdf_Grid_PdfGrid_Syncfusion_UI_Xaml_TreeGrid_Converter_TreeGridPdfExportingOptions_) method of the [TreeGridToPdfConverter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.Converter.TreeGridToPdfConverter.html) class.
3838

39-
```c#
39+
``` csharp
4040
var options = new TreeGridPdfExportingOptions();
4141
options.AllowIndentColumn = true;
4242
options.FitAllColumnsInOnePage = true;
43-
4443
var document = treeGrid.ExportToPdf(options, true);
45-
4644
PdfViewerControl pdfViewer = new PdfViewerControl();
4745
MemoryStream stream = new MemoryStream();
4846
document.Save(stream);
@@ -57,10 +55,12 @@ pdfViewer.Print(true);
5755
public class TreeGridCustomPdfConverter : TreeGridToPdfConverter
5856
{
5957
internal bool _excludeNonExpandedNodes;
58+
6059
public TreeGridCustomPdfConverter(bool excludeNonExpandedNodes) :base()
6160
{
6261
_excludeNonExpandedNodes = excludeNonExpandedNodes;
6362
}
63+
6464
/// <summary>
6565
/// ExportNodes to PDF
6666
/// </summary>

0 commit comments

Comments
 (0)