New to Telerik ReportingStart a free 30-day trial

Represents a user-defined field in a DataSource.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

C#
[TypeConverter(typeof(CalculatedFieldConverter))]
public class CalculatedField

Inheritance: objectCalculatedField

Constructors

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

C#
public CalculatedField()

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

C#
public CalculatedField(string name, Type dataType, string expression)
Parameters:namestring

The name of the calculated field.

dataTypeType

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

expressionstring

The expression formula that computes the field's value.

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

C#
public CalculatedField(string name, Type dataType)
Parameters:namestring

The name of the calculated field.

dataTypeType

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

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

C#
public CalculatedField(string name)
Parameters:namestring

The name of the calculated field.

Properties

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

C#
[TypeConverter(typeof(SystemTypeConverter))]
public Type DataType { get; set; }
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.

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

C#
public string Expression { get; set; }
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

string

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

C#
public string Name { get; set; }
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

PropertyChangedEventHandler

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

C#
public event PropertyChangedEventHandler PropertyChanged