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

XRControl.KeepTogether Property

Specifies whether a control can be split across pages.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[SRCategory(ReportStringId.CatBehavior)]
[DefaultValue(true)]
public virtual bool KeepTogether { get; set; }

Property Value

Type Default Description
Boolean true

true, to print the control’s on the next page; otherwise, false.

Remarks

The KeepTogether property specifies whether a control’s content can be horizontally split across pages. If the content of the control is larger than the remaining space on the page, this property specifies whether to split this content across the current page and the next page, or print the control in its entirety on the next page.

This property is in effect only when a control’s content does not fit onto the current page.

When a control’s content does not fit on the next page, this content is split among multiple pages and the KeepTogether property is ignored.

The following table illustrates the KeepTogether property in action.

KeepTogether = false

KeepTogether = true

The following image illustrates a simple report with a label having its KeepTogether property set to false, splitting the label’s contents across two pages.

KeepTogether01.png

The following image illustrates a label having the KeepTogether property set to true, moving the label’s contents to the next page (“keeping its contents together”).

KeepTogether02.png

This property is in effect when a control is split in a horizontal direction only. To specify whether a control should be split across pages in a vertical direction (if a control contents are outside the right page margin), use the XtraReport.VerticalContentSplitting property.

Note

This property is ignored when exporting a report to RTF or DOCX file as a single file, as follows:

To learn more, see Laying out Dynamic Report Contents.

See Also