WinControlContainer.PrintMode Property

Gets or sets whether to render a control inside the WinControlContainer as a Printing System brick or as an image.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll


public virtual WinControlPrintMode PrintMode { get; set; }
Public Overridable Property PrintMode As WinControlPrintMode

Property Value

Type Default Description


A value that specifies whether to render a control inside the WinControlContainer as a brick or as an image.


This property specifies how to render a control that is placed inside the WinControlContainer:

  • AsBrick
    A control is rendered as a set of Printing System bricks.
  • AsImage
    A control is rendered as an image.
    The ImageType property specifies whether the image is a bitmap or metafile.
  • Default
    If the WinControlContainer is placed onto a DetailBand, ReportHeaderBand, or ReportFooterBand, its control is rendered as a set of bricks. Otherwise, the control is rendered as an image.


The code sample below creates a DataGridView control instance and adds this instance to a report. The sample specifies that the DataGridView control is printed as a bitmap image.

using System.Windows.Forms;
using DevExpress.XtraReports.UI;
// ...
// Create an XtraReport instance.
XtraReport report = new XtraReport() {
    Bands = {
        new DetailBand()
// Create a DataGridView control instance.
DataGridView dataGridView = new DataGridView();
// Create a WinControlContainer instance for the data grid.
WinControlContainer winControlContainer = new WinControlContainer();
// Place the data grid inside the WinControlContainer.
winControlContainer.WinControl = dataGridView;
// Specify that the WM_PAINT message is used to print the control inside the WinControlContainer.
winControlContainer.DrawMethod = WinControlDrawMethod.UseWMPaint;
// Specify that the control inside the WinControlContainer is always printed as an image.
winControlContainer.PrintMode = WinControlPrintMode.AsImage;
// Specify that the printed image is a bitmap, not a metafile.
winControlContainer.ImageType = WinControlImageType.Bitmap;
// Specify that the control should synchronize its bounds with the WinControlContainer's bounds.
winControlContainer.SyncBounds = true;
// Add the printable component container to the report.
See Also