We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to print TreeViewAdv or GridTreeControl

Thread ID:

Created:

Updated:

Platform:

Replies:

124134 May 19,2016 11:31 AM UTC May 24,2016 11:52 AM UTC WPF 3
loading
Tags: GridTreeControl
stelios
Asked On May 19, 2016 11:31 AM UTC

hi, 
new member here..
Is there any way  to print TreeViewAdv control ? with multi column or what ever the control is displayed ? 
i also interesting if it's possible to print GridTreeControl as well.

i have search several forums, first of all here .. but not any interesting answers , google also results nothing regarding the questions.

Any help ..? 

Venkateshwaran Ramdoss [Syncfusion]
Replied On May 20, 2016 09:41 AM UTC

Hi Stelios,

Query #1:"Is there any way to print TreeViewAdv control ?"

We have prepared a sample which tries to meet your requirement. In this sample, we have used PrintVisual method in PrintDialog class to print the TreeViewAdv content. Please download the sample from the below link.

Sample: TreeViewAdvPrintSample

Query #2:"Is it possible to print GridTreeControl ?"

We have prepared a sample based on your requirement. In this sample, we have used "Print" method in the button click event to print the GridTreeControl. Please download the same from the below link.

Sample: GridTreeControlPrintSample

Regards,
Venkateshwaran V.R.

Ashwini Paranthaman [Syncfusion]
Replied On May 23, 2016 10:18 AM UTC

From: stelios charalambous
Sent: Monday, May 23, 2016 5:57 AM
To: Syncfusion Support
Subject: RE: Syncfusion support community forum 124134, How to print TreeViewAdv or GridTreeControl, has been updated.
 

Hello, 
thank you for your reply and help,  
I would like to ask if is possible to print TreeGridControl with header and footer . is this possible?  


Srinivasan Vasu [Syncfusion]
Replied On May 24, 2016 11:52 AM UTC

Hi Stelios, 
 
We have analyzed your query and we have prepared a sample as your requirement. In GridTreeControl, you can print the Header and Footer Template using GridTreeControl.InternalGrid.PrintHeaderTemplate and GridTreeControl.InternalGrid.PrintFooterTemplate property. 
 
Please refer the below code example. 
 
C# 
private void btn_Click(object sender, RoutedEventArgs e) 
        { 
// Print Header Template 
            treeGrid.InternalGrid.PrintHeaderHeight = 50; 
            treeGrid.InternalGrid.PrintHeaderTemplate = Application.Current.FindResource("PrintHeaderTemplate") as DataTemplate; 
// Print Footer Template 
            treeGrid.InternalGrid.PrintFooterHeight = 50; 
            treeGrid.InternalGrid.PrintFooterTemplate = Application.Current.FindResource("PrintFooterTemplate") as DataTemplate; 
            treeGrid.ShowPrintDialog();             
        } 
 
XAML 
 
// Header Template 
   <DataTemplate x:Key="PrintHeaderTemplate"> 
            <Grid> 
                <TextBlock HorizontalAlignment="Left" 
                           VerticalAlignment="Center" 
                           FontSize="20" 
                           Text="Employee Details" /> 
            </Grid> 
        </DataTemplate> 
 
// Footer Template 
        <DataTemplate x:Key="PrintFooterTemplate"> 
            <Grid> 
                <TextBlock HorizontalAlignment="Center" 
                           FontSize="20" 
                           Text="{Binding Source={x:Static sys:DateTime.Today}, 
                                          StringFormat='{}{0:dddd, MMMM dd, yyyy}'}" >                                  
                </TextBlock> 
            </Grid> 
        </DataTemplate> 
 
 
Sample Location: GridTreeControlPrintSample 
 
Regards, 
Srinivasan 
 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;