Skip to main content
.NET Framework 4.6.2+

DataViewExpression Class

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

Namespace: DevExpress.ExpressApp.Utils

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public class DataViewExpression

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.

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