Back to Devexpress

DataViewExpression Class

expressappframework-devexpress-dot-expressapp-dot-utils-127655dd.md

latest2.6 KB
Original Source

DataViewExpression Class

Specifies a data view column name and expression used to compute the column value.

Namespace : DevExpress.ExpressApp.Utils

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public class DataViewExpression
vb
Public Class DataViewExpression

The following members return DataViewExpression objects:

Remarks

Use this class when it is required to create a list of data records retrieved from a database without loading complete business classes (a data view). Values in each data record can be obtained from specific business class properties directly, or be evaluated by the database server using complex expressions. The IList< DataViewExpression > list can be passed to the IObjectSpace.CreateDataView method, XafDataView constructor or XafDataView.Expressions property.

csharp
List<DataViewExpression> dataViewExpressions = new List<DataViewExpression>();
dataViewExpressions.Add(
    new DataViewExpression("ID", new OperandProperty("ID")));
dataViewExpressions.Add(new DataViewExpression(
    "Name.UpperCase", new FunctionOperator(FunctionOperatorType.Upper, new OperandProperty("Name"))));
dataViewExpressions.Add(new DataViewExpression(
    "Count", new AggregateOperand("Sales", Aggregate.Count)));
var dataView = objectSpace.CreateDataView(typeof(Sale), dataViewExpressions, null, null);

Inheritance

Object DataViewExpression

See Also

DataViewExpression Members

CreateDataView

DevExpress.ExpressApp.Utils Namespace