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

XRPanel Class

A Panel control that can contain other controls.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v17.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[DefaultBindableProperty(null)]
public class XRPanel :
    XRControl

Remarks

An XRPanel object can be used to group individual report controls into collections. Controls placed onto an XRPanel control can be moved, copied, pasted, etc. along with the panel which contains them. The collection of contained controls is accessed via the XRControl.Controls property of the XRPanel object.

Note

It is not possible to place an XRSubreport into the XRPanel control, because this results in an incorrect construction of the report document.

To learn more about the XRPanel control, see the Adding Contents to a Report topic.

Example

The following method creates an XRPanel object, then creates an XRControl object, and adds it to the created panel.

using System.Drawing;
using DevExpress.XtraReports.UI;
// ...

public XRPanel CreateXRPanel() {
   // Create a panel.
   XRPanel xrPanel = new XRPanel();

   // Set its background color.
   xrPanel.BackColor = Color.Blue;

   // Set its size.
   xrPanel.SizeF = new SizeF(200F, 100F);

   // Create an XRControl object.
   XRControl xrControl = new XRControl();

   // Set its background color.
   xrControl.BackColor = Color.Aquamarine;

   // Set its size.
   xrControl.SizeF = new SizeF(100F, 50F);

   // Add a control to the panel.
   xrPanel.Controls.Add(xrControl); 

   return xrPanel;
}

Implements

See Also