IModelMember.IsCalculated Property
Specifies whether or not the custom field is calculated.
Namespace: DevExpress.ExpressApp.Model
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Property Value
Type | Description |
---|---|
Boolean | true, when the custom field is calculated; otherwise - false. |
Remarks
The IsCalculated property is visible in the Model Editor for custom fields only.
To define a calculated field, set the IsCalculated property to true and pass the expression used to compute this field value to the IModelMember.Expression property.
To define a persistent field, set the IsCalculated property to false. Note that creation of custom persistent fields is allowed at design time only, by default (the IsCalculated property is not editable at runtime). To allow end users to add custom persistent fields at runtime, set the static ModelMemberReadOnlyCalculator.AllowPersistentCustomProperties property to true. To allow updating the database schema after a field is added at runtime, set the XafApplication.DatabaseUpdateMode property to UpdateDatabaseAlways. A column mapped to the current field will be added to the database table automatically.
Note
Generally, persistent fields should be added only at design time. It is a bad practice to allow and users to alter the database schema - allow this only as a last resort.