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

SfDataGrid Printing - Left and right lines

Hello,

I've been searching for a way to remove the side lines when printing a SfDataGrid but I have been unable to find a way to prevent them from showing up.

You can see an example of these lines on the syncfusion site: http://help.syncfusion.com/uwp/sfdatagrid/printing#page-settings

Basically, I don't want the left and right line border to be there, it feels like this should be real simple but I can't find a way to shut them off... can anyone enlighten me on how I shut them off?

Thank you,
Michael

3 Replies

SV Srinivasan Vasu Syncfusion Team May 6, 2016 11:19 AM UTC

Hi Micheal, 
 
Thanks for contacting Syncfusion support. 
 
We have analyzed your query and you can achieve your requirement by editing the style of PrintPageControl in SfDataGrid as like in the below code example. 
To print SfDataGrid with custom style you have to set PrintSettings.AllowPrintStyles property as false. 
 
Please refer the below code example. 
 
XAML 
<Application.Resources> 
        <Style TargetType="syncfusion:PrintPageControl"> 
            <Setter Property="BorderThickness" Value="0"/> 
        </Style> 
    </Application.Resources> 
 
 
 
C# 
  private void Button_Click(object sender, RoutedEventArgs e) 
        {         
            Grid.PrintSettings = new PrintSettings(); 
            Grid.PrintSettings.AllowPrintStyles = false; 
            Grid.Print(); 
        }    
 
 
Please download sample from the below location. 
 
 
Regards, 
Srinivasan 
 



SD Spartan Developer May 6, 2016 01:16 PM UTC

Hello Srinivasan,

That worked nicely!

Thank you,
Michael


SV Srinivasan Vasu Syncfusion Team May 9, 2016 08:54 AM UTC

Hi Micheal, 
  
Thanks for your update. 
  
Regards, 
Srinivasan 


Loader.
Live Chat Icon For mobile
Up arrow icon