Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BandFactory Class

Enables you to customize the process of creating report bands in the End-User Report Designer.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

#Declaration

public class BandFactory

#Remarks

The following example illustrates how to use the BandFactory class for overriding the default behavior for adding new Page Headers to a report.

using DevExpress.XtraReports.UI;
// ...

public class MyCustomPageHeaderBand : PageHeaderBand {
    public string MyCustomBandProperty { get; set; }
}

public class MyCustomBandFactory : BandFactory {
    public override Band CreateInstance(BandKind bandKind) {
        if (bandKind == BandKind.PageHeader)
            return new MyCustomPageHeaderBand();
        return base.CreateInstance(bandKind);
    }
}

To register a custom band factory, assign it to the protected static bandFactory property of the XtraReportBase class.

using DevExpress.XtraReports.UI;
// ...

public class XtraReport1 : XtraReport {
    public XtraReport1() {
        InitializeComponent();
        bandFactory = new MyCustomBandFactory();
    }
}

#Inheritance

Object
BandFactory
See Also