SRCategoryAttribute Class

Enables you to specify the Property Grid category where a custom property should be placed.

Namespace: DevExpress.XtraReports

Assembly: DevExpress.XtraReports.v18.2.dll


[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All)]
public sealed class SRCategoryAttribute :
<AttributeUsage(AttributeTargets.Assembly Or AttributeTargets.Module Or AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Enum Or AttributeTargets.Constructor Or AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Field Or AttributeTargets.Event Or AttributeTargets.Interface Or AttributeTargets.Parameter Or AttributeTargets.Delegate Or AttributeTargets.ReturnValue Or AttributeTargets.GenericParameter Or AttributeTargets.All)>
Public NotInheritable Class SRCategoryAttribute
    Inherits CategoryAttribute

This attribute enables you to locate a property in a Property Grid 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.


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.
public class MyCustomLabel : XRLabel {
    // The following line specifies the Property Grid category, 
    // where a custom property is located.
    // When BindableAttribute is applied, the property will appear
    // in the Data category, as well as in the custom category (if specified).
    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; }



See Also