Search This Blog

Friday, February 8, 2013

Silverlight DevExpress DXperience Grid Printing Layouts

This example shows how to use simple templates in DevExpress printing mechanism. The most important thing you can't miss is that it is absolutely essential to use DevExpress template controls in DataTemplate - plain Silverlight controls are simply removed when the template is processed. In this example this is <dxe:TextEdit /> used instead of Silverlight's <TextBlock>.

    <DataTemplate x:Key="headerTemplate">
      <dxe:TextEdit  Text="{Binding Path=Content, Mode=OneWay}" />

var preview = new DocumentPreviewWindow();

var link = CreateExportServiceLink(gridControl, preview);

private PrintableControlLink CreateExportServiceLink(

IPrintableControl gridControl, 
DocumentPreviewWindow documentPreviewWindow)
{ var link = new PrintableControlLink(gridControl)
ExportServiceUri = "",
Landscape = true
var model = new LinkPreviewModel(link);
documentPreviewWindow.Model = model;

return link;}

private void PrepareHeader(PrintableControlLink link)

link.ReportHeaderTemplate = (DataTemplate)Resources["headerTemplate"];
link.ReportHeaderData = "Text to be displayed";

No comments:

Post a Comment

If you like this post, please leave a comment :)