DashboardSqlDataSource.CalculatedFields Property
Provides access to a data source’s calculated fields.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.2.Core.dll
Declaration
Property Value
Type | Description |
---|---|
CalculatedFieldCollection | A CalculatedFieldCollection object containing calculated fields. |
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