Back to Devexpress

XPView.AddProperty(String, CriteriaOperator) Method

xpo-devexpress-dot-xpo-dot-xpview-dot-addproperty-x28-system-dot-string-devexpress-dot-data-dot-filtering-dot-criteriaoperator-x29.md

latest4.3 KB
Original Source

XPView.AddProperty(String, CriteriaOperator) Method

Creates a new ViewProperty object with the specified expression and appends it to the XPView.Properties collection.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public ViewProperty AddProperty(
    string name,
    CriteriaOperator property
)
vb
Public Function AddProperty(
    name As String,
    property As CriteriaOperator
) As ViewProperty

Parameters

NameTypeDescription
nameString

A String value which specifies the property name. This value is assigned to the ViewProperty.Name property.

| | property | CriteriaOperator |

A CriteriaOperator object which specifies the expression used to calculate the values in a column.

|

Returns

TypeDescription
ViewProperty

The ViewProperty object that was added to the collection.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the AddProperty(String, CriteriaOperator) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

XPO_how-to-implement-custom-aggregates/CS/XpoCustomAggregate/Form1.cs#L20

csharp
XPView xpView = new XPView(session1, typeof(Customer));
xpView.AddProperty("ContactName", CriteriaOperator.Parse("[FirstName] + ' ' + [LastName]"));
xpView.AddProperty("DistinctProducts", CriteriaOperator.Parse("[Orders][].CountDistinct([ProductName])"));

asp-net-mvc-grid-custom-binding-and-xpo/CS/XPCustomBindingExample/XPO/XpoBindingHandlers.cs#L46

csharp
string name = string.Concat(summaryItem.FieldName, summaryItem.SummaryType);
    data.AddProperty(name, property);
}

XPO_how-to-implement-custom-aggregates/VB/XpoCustomAggregate/Form1.vb#L21

vb
Dim xpView As New XPView(session1, GetType(Customer))
xpView.AddProperty("ContactName", CriteriaOperator.Parse("[FirstName] + ' ' + [LastName]"))
xpView.AddProperty("DistinctProducts", CriteriaOperator.Parse("[Orders][].CountDistinct([ProductName])"))

asp-net-mvc-grid-custom-binding-and-xpo/VB/XPCustomBindingExample/XPO/XpoBindingHandlers.vb#L46

vb
Dim name As String = String.Concat(summaryItem.FieldName, summaryItem.SummaryType)
    data.AddProperty(name, [property])
Next summaryItem

See Also

XPView Class

XPView Members

DevExpress.Xpo Namespace