Back to Devexpress

ObjectCaptionFormatAttribute Class

expressappframework-devexpress-dot-persistent-dot-base-e7e7f0a0.md

latest3.1 KB
Original Source

ObjectCaptionFormatAttribute Class

Specifies a caption format for the target business class’ objects.

Namespace : DevExpress.Persistent.Base

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
public class ObjectCaptionFormatAttribute :
    Attribute
vb
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Interface, Inherited:=True, AllowMultiple:=False)>
Public Class ObjectCaptionFormatAttribute
    Inherits Attribute

Remarks

Currently, business object captions are only used for captions of the corresponding detail forms. By default, a caption format is specified by the Application Model‘s BOModel | <Class> node’s IModelClass.ObjectCaptionFormat. This property’s value is formed from the BOModel | <Class> node’s IModelClass.FriendlyKeyProperty and/or IModelClass.DefaultProperty properties.

You can set a custom caption format directly in the Application Model via the Model Editor. In addition, you can do it in code. For this purpose, apply the ObjectCaptionFormat attribute to the required business class. Specify the caption format as the attribute’s ObjectCaptionFormatAttribute.FormatString parameter. This format will be set for the ObjectCaptionFormat property of the Application Model‘s BOModel | <Class> node, where it can be changed. The format specifyed in the Application Model will be used in the UI.

Note

By default, the caption format set for a business class via the ObjectCaptionFormat attribute is set for its descendants as well.

Inheritance

Object Attribute ObjectCaptionFormatAttribute

See Also

ObjectCaptionFormatAttribute Members

DevExpress.Persistent.Base Namespace