CalculatedField
Represents a user-defined field in a DataSource.
Definition
Namespace:Telerik.Reporting
Assembly:Telerik.Reporting.dll
Syntax:
[TypeConverter(typeof(CalculatedFieldConverter))]
public class CalculatedField
Inheritance: objectCalculatedField
Constructors
Initializes a new instance of the CalculatedField class with default values.
public CalculatedField()
Initializes a new instance of the CalculatedField class with the specified name, data type, and expression.
public CalculatedField(string name, Type dataType, string expression)
The name of the calculated field.
dataTypeTypeThe expected data type of the calculated field's value.
expressionstringThe expression formula that computes the field's value.
Initializes a new instance of the CalculatedField class with the specified name and data type.
public CalculatedField(string name, Type dataType)
The name of the calculated field.
dataTypeTypeThe expected data type of the calculated field's value.
Initializes a new instance of the CalculatedField class with the specified name.
public CalculatedField(string name)
The name of the calculated field.
Properties
DataType
Type
Gets or sets the expected data type of the value produced by the calculated field's expression.
[TypeConverter(typeof(SystemTypeConverter))]
public Type DataType { get; set; }
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
string
Gets or sets the expression formula that defines how the calculated field's value is computed.
public string Expression { get; set; }
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.
public string Name { get; set; }
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.
public event PropertyChangedEventHandler PropertyChanged