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
close icon

sfDataGrid Print problem.

As in Attach file,i have a datagrid with stackedheader-Grid.png.
my code:
dgOutStorage.PrintSettings = new PrintSettings();
            dgOutStorage.PrintSettings.PrintManagerBase = new CustomPrintManager(this.dgOutStorage);
            dgOutStorage.PrintSettings.AllowPrintStyles = false;
            dgOutStorage.PrintSettings.PrintScaleOption = PrintScaleOptions.FitAllColumnsonOnePage;
            dgOutStorage.PrintSettings.PrintPageOrientation = PrintOrientation.Portrait;
            DataTemplate cardLayout = new DataTemplate();
            FrameworkElementFactory cardHolder = new FrameworkElementFactory(typeof(TextBlock));
            cardHolder.SetValue(TextBlock.TextProperty, title);
            cardHolder.SetValue(TextBlock.FontSizeProperty, 20.0);
            cardHolder.SetValue(TextBlock.HorizontalAlignmentProperty, HorizontalAlignment.Center);
            cardLayout.VisualTree = cardHolder;
            dgOutStorage.PrintSettings.PrintPageHeaderTemplate = cardLayout;
            dgOutStorage.PrintSettings.PrintPageHeaderHeight = 30;
            dgOutStorage.PrintSettings.PrintPageMargin = new Thickness(2.5, 2.5, 2.5, 2.5);
1.Print result like 1.oxps,stackheader not print.
2.PrintPageMargin not working.

Attachment: Desktop_cd193d29.7z

2 Replies

RA ray July 2, 2016 05:18 AM UTC

I also try to exporttopdf  then print .As Chinese charactor in sfdatagrid row,It will miss Chinese charactor when convert to pdf

EM Elavarasan M Syncfusion Team July 4, 2016 12:09 PM UTC

Hi Ray, 
We have created the support incident under your account to track the status of this SfDataGrid printing requirement. Please log on to our support website to check for further updates. 
Elavarasan M

Live Chat Icon For mobile
Up arrow icon