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

SRCategoryAttribute Class

Enables you to specify the Properties window category where a custom property should be placed.

Namespace: DevExpress.XtraReports

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

#Declaration

[AttributeUsage(AttributeTargets.All)]
public sealed class SRCategoryAttribute :
    CategoryAttribute

#Remarks

This attribute enables you to locate a property in a Properties window category localized using ReportStringId. In other aspects, it is similar to the is similar to CategoryAttribute.

When both the SRCategoryAttribute and BindableAttribute are specified, the property will appear in both the Data and the custom category.

When no custom category is specified, a property appears in the Misc category.

#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 Properties window 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 Properties window category is specified, 
    // a property appears in the Misc category.
    public string MyCustomBandProperty { get; set; }
}

#Inheritance

See Also