Skip to main content
.NET 8.0+

ViewPropertiesCollection.Add(ViewProperty) Method

Adds the specified object to the collection.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.2.dll

Declaration

public void Add(
    ViewProperty sortProperty
)

Parameters

Name Type Description
sortProperty ViewProperty

A ViewProperty object to add to the collection.

Example

The following example demonstrates how to populate the view’s XPView.Properties collection.

using DevExpress.Xpo;
// ...
xpView1.Properties.AddRange(new ViewProperty[] {
  new ViewProperty("Name", SortDirection.None, "[Name]", false, true),
  new ViewProperty("CompanyName", SortDirection.None, "[Customer.CompanyName]", false, true),
  new ViewProperty("Payment", SortDirection.None, "[Payments].Sum([Amount])", false, true),
  new ViewProperty("EmployeeFullName", SortDirection.None, "[Employee.FirstName] + ' ' + 
    [Employee.LastName]", false, true)});

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add(ViewProperty) 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.

See Also