Class CalculatedField
Represents an user-defined field in a DataSource.
Inheritance
Namespace: Telerik.Reporting
Assembly: Telerik.Reporting.dll
Syntax
public class CalculatedField : INotifyPropertyChanged
Remarks
Calculated fields enable creating custom data columns that are computed at runtime using expressions that can reference other fields in the data source. These fields support property change notifications and can be used in data binding scenarios to create dynamic, derived data values for reporting purposes.
Constructors
CalculatedField()
Initializes a new instance of the CalculatedField class with default values.
Declaration
public CalculatedField()
CalculatedField(String)
Initializes a new instance of the CalculatedField class with the specified name.
Declaration
public CalculatedField(string name)
Parameters
|
System.String
name
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
public CalculatedField(string name, Type dataType)
Parameters
|
System.String
name
The name of the calculated field. |
|
System.Type
dataType
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
public CalculatedField(string name, Type dataType, string expression)
Parameters
|
System.String
name
The name of the calculated field. |
|
System.Type
dataType
The expected data type of the calculated field's value. |
|
System.String
expression
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
public Type DataType { get; set; }
Property Value
|
System.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
public string Expression { get; set; }
Property Value
|
System.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
public string Name { get; set; }
Property Value
|
System.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
public event PropertyChangedEventHandler PropertyChanged
Event Type
|
System.ComponentModel.PropertyChangedEventHandler
|