Skip to main content

CalculatedField.DataType Property

For internal use.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v24.2.Core.dll

NuGet Package: DevExpress.Dashboard.Core

#Declaration

[Browsable(false)]
[DefaultValue(CalculatedFieldType.Auto)]
public CalculatedFieldType DataType { get; set; }

#Property Value

Type Default
CalculatedFieldType Auto

Available values:

Name Description
String

The field returns a String value (the String type).

Integer

The field returns an Integer value (the Int32 type).

Decimal

The field returns a Decimal value (the Decimal type).

Boolean

The field returns a Boolean value (the Boolean type).

DateTime

The field returns a date-time value (the DateTime type).

Object

The field returns a value of any type.

Auto

A field type is detected automatically based on the type of values returned by CalculatedField.Expression.

Double

The field returns a Double value (the Double type).

#Remarks

The type of a newly created calculated field is detected automatically based on the type of values returned by the specified expression. To change the type of the calculated field, insert the required conversion function (such as ToStr, ToDecimal, ToInt, etc.) into the calculated field’s expression (the CalculatedField.Expression property). For instance, the following expression contains the ToDecimal conversion function that is used to change the default field type:

ToDecimal([UnitPrice] * (1 - [Discount]))

Use the IDashboardDataSource.GetFieldSourceType property to get the calculated field’s type.

See Also