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. Image for the cookie policy date

How to print TreeViewAdv or GridTreeControl

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 ..? 

3 Replies

VR Venkateshwaran Ramdoss Syncfusion Team 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.


AP Ashwini Paranthaman Syncfusion Team 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?  



SV Srinivasan Vasu Syncfusion Team 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 
 



Loader.
Up arrow icon