Skip to main content
A newer version of this page is available. .

WinControlContainer.WinControl Property

Gets or sets a Control class instance that is placed inside the WinControlContainer.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[Browsable(false)]
[DefaultValue(null)]
public virtual Control WinControl { get; set; }

Property Value

Type Default Description
Control *null*

A Control class instance or descendant.

Example

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.
report.Bands[BandKind.Detail].Controls.Add(winControlContainer);

The following code snippets (auto-collected from DevExpress Examples) contain references to the WinControl property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also