Skip to main content
.NET 6.0+

DataViewExpression Class

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

Namespace: DevExpress.ExpressApp.Utils

Assembly: DevExpress.ExpressApp.v23.2.dll

NuGet Package: DevExpress.ExpressApp


public class DataViewExpression


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>();
    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);


See Also