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

DefaultBindablePropertyAttribute Class

Enables you to make a custom property the default property to bind a XRControl descendant when dropping a Field List item on the control.

Namespace: DevExpress.XtraReports

Assembly: DevExpress.XtraReports.v20.2.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core

Declaration

[AttributeUsage(AttributeTargets.Class)]
public sealed class DefaultBindablePropertyAttribute :
    Attribute

Example

This example illustrates the use of the DefaultBindablePropertyAttribute and SRCategoryAttribute that define the behavior of custom properties specified for XRControl descendants.

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

// The following line specifies the default property to bind the control 
// to a field dropped from the Field List.
[DefaultBindableProperty("MyCustomProperty")]
public class MyCustomLabel : XRLabel {
    // The following line specifies the Property Grid category, 
    // where a custom property is located.
    [SRCategory(ReportStringId.CatAppearance)]
    // When BindableAttribute is applied, the property will appear
    // in the Data category, as well as in the custom category (if specified).
    [System.ComponentModel.Bindable(true)]
    public string MyCustomProperty { get; set; }
}

public class MyCustomPageHeaderBand : PageHeaderBand {
    // When no custom Property Grid category is specified, 
    // a property appears in the Misc category.
    public string MyCustomBandProperty { get; set; }
}

Implements

Inheritance

Object
Attribute
DefaultBindablePropertyAttribute
See Also