The requested page is not available for the requested platform. You are viewing the content for Default platform.

XRPanel Class

A Panel control that can contain other controls.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll

Declaration

[DefaultBindableProperty(null)]
public class XRPanel :
    XRControl
<DefaultBindableProperty(Nothing)>
Public Class XRPanel
    Inherits XRControl

Remarks

The XRPanel control is a container that groups individual report controls into collections and allows you to move, copy and paste them. The panel also visually unites report controls in Print Preview (for instance, with borders or a uniform color background).

To add a panel to a report, drag the XRPanel item from the DX:19.1: Report Controls Toolbox tab and drop it onto the required report band.

RD_Controls_Panel

Drop the desired report controls onto the panel to combine them to a group.

The Report Explorer displays controls placed onto a panel as its subordinate nodes.

report-control-panel-0

The panel cannot contain the following report controls:

If a panel includes only one control, you can right-click this control and use the Fit Bounds to Container command in the context menu. This command resizes the control so that it occupies all the available container space (excluding borders).

You can also enable the XRPanel.CanShrink property to automatically adjusts the panel's size to fit all the inner controls. For instance, this allows preventing blank areas when you conditionally hide specific controls.

Note

The Panel control cannot span several report bands as cross-band controls can.

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

Examples

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

DevExpress.XtraPrinting.IBrickOwner
DevExpress.Utils.Serializing.Helpers.IXtraSupportDeserializeCollectionItem
DevExpress.Utils.Serializing.IXtraSerializable
See Also