xpo-devexpress-dot-xpo-dot-xpview-dot-addproperty-x28-system-dot-string-devexpress-dot-data-dot-filtering-dot-criteriaoperator-x29.md
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
public ViewProperty AddProperty(
string name,
CriteriaOperator property
)
Public Function AddProperty(
name As String,
property As CriteriaOperator
) As ViewProperty
| Name | Type | Description |
|---|---|---|
| name | String |
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.
|
| Type | Description |
|---|---|
| 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
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
string name = string.Concat(summaryItem.FieldName, summaryItem.SummaryType);
data.AddProperty(name, property);
}
XPO_how-to-implement-custom-aggregates/VB/XpoCustomAggregate/Form1.vb#L21
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
Dim name As String = String.Concat(summaryItem.FieldName, summaryItem.SummaryType)
data.AddProperty(name, [property])
Next summaryItem
See Also