DashboardSqlDataSource.CalculatedFields Property
In This Article
Provides access to a data source’s calculated fields.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.2.Core.dll
NuGet Package: DevExpress.Dashboard.Core
#Declaration
public CalculatedFieldCollection CalculatedFields { get; }
#Property Value
Type | Description |
---|---|
Calculated |
A Calculated |
#Remarks
To learn more about calculated fields, see the following topics.
- Calculated Fields - Overview
- WinForms Designer - Creating Calculated Fields
- Web Dashboard - Creating Calculated Fields
#Example
The following code snippet shows how to create a new calculated field based on the values of the ‘UnitPrice’ and ‘Discount’ data fields, and add it to the existing DashboardSqlDataSource.
using DevExpress.DashboardCommon;
//...
CalculatedField priceWithDiscount = new CalculatedField("[UnitPrice] * (1 - [Discount])");
priceWithDiscount.DataMember = "SalesPerson";
priceWithDiscount.Name = "Price with discount";
sqlDataSource.CalculatedFields.Add(priceWithDiscount);
#Implements
See Also