Back to Devexpress

XRControl.KeepTogether Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrcontrol-3697b764.md

latest4.5 KB
Original Source

XRControl.KeepTogether Property

Specifies whether a control can be split across pages.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DefaultValue(true)]
[SRCategory(ReportStringId.CatBehavior)]
public virtual bool KeepTogether { get; set; }
vb
<SRCategory(ReportStringId.CatBehavior)>
<DefaultValue(True)>
Public Overridable Property KeepTogether As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true , to keep the contents of the entire control on a single page; otherwise, false.

|

Remarks

The KeepTogether property specifies whether control content can be horizontally split across pages. If control content 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 to print the control in its entirety on the next page.

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

When control 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 label contents across two pages.

|

The following image illustrates a label with the KeepTogether property set to true as its contents are moved to the next page (“keeping its contents together”).

|

Limitations

The KeepTogether 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 of the right page margin), use the XtraReport.VerticalContentSplitting property.

Export

The KeepTogether property is ignored when you export a report to an RTF or DOCX file as a single file:

XRCrossTab Control

The KeepTogether property does not work for vertical page breaks (when the XRCrossTab control width exceeds the page width).

The KeepTogether property does not work for the XRCrossTab control cells that span across multiple rows.

For more information, review the following help topic: Arrange Dynamic Report Contents.

See Also

XtraReport.VerticalContentSplitting

GroupHeaderBand.GroupUnion

GroupFooterBand.GroupUnion

Arrange Dynamic Report Contents

XRControl Class

XRControl Members

DevExpress.XtraReports.UI Namespace