Class
CalculatedField

Represents a user-defined field in a DataSource.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

cs-api-definition
[TypeConverter(typeof(CalculatedFieldConverter))]
public class CalculatedField

Inheritance: objectCalculatedField

Constructors

CalculatedField()

Initializes a new instance of the CalculatedField class with default values.

Declaration

cs-api-definition
public CalculatedField()

CalculatedField(string)

Initializes a new instance of the CalculatedField class with the specified name.

Declaration

cs-api-definition
public CalculatedField(string name)

Parameters

name

string

The name of the calculated field.

CalculatedField(string, Type)

Initializes a new instance of the CalculatedField class with the specified name and data type.

Declaration

cs-api-definition
public CalculatedField(string name, Type dataType)

Parameters

name

string

The name of the calculated field.

dataType

Type

The expected data type of the calculated field's value.

CalculatedField(string, Type, string)

Initializes a new instance of the CalculatedField class with the specified name, data type, and expression.

Declaration

cs-api-definition
public CalculatedField(string name, Type dataType, string expression)

Parameters

name

string

The name of the calculated field.

dataType

Type

The expected data type of the calculated field's value.

expression

string

The expression formula that computes the field's value.

Properties

DataType

Gets or sets the expected data type of the value produced by the calculated field's expression.

Declaration

cs-api-definition
[TypeConverter(typeof(SystemTypeConverter))]
public Type DataType { get; set; }

Property Value

Type

Remarks

This type information helps with type safety and proper data conversion during expression evaluation. If not specified, the type will be inferred from the expression evaluation at runtime.

Expression

Gets or sets the expression formula that defines how the calculated field's value is computed.

Declaration

cs-api-definition
public string Expression { get; set; }

Property Value

string

Remarks

The expression can reference other fields in the data source using syntax like Fields.FieldName and supports various operators, functions, and constants. Changes to this property trigger property change notifications for data binding support.

Name

Gets or sets the unique identifier name of the calculated field.

Declaration

cs-api-definition
public string Name { get; set; }

Property Value

string

Remarks

This name is used to reference the calculated field in expressions and data binding operations. The name should be unique within the data source's calculated fields collection.

Events

PropertyChanged

Occurs when a property value changes, supporting data binding and change tracking scenarios.

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler