Skip to main content
.NET Framework 4.5.2+

ViewPropertiesCollection.Add(ViewPropertiesCollection) Method

Adds the objects in the specified collection to the current collection.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public void Add(
    ViewPropertiesCollection sortProperties
)

Parameters

Name Type Description
sortProperties ViewPropertiesCollection

A ViewPropertiesCollection object which represents the collection whose elements are appended to the current 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)});
See Also