Skip to main content
A newer version of this page is available. .

ViewPropertiesCollection.AddRange(ViewProperty[]) Method

Adds an array of ViewProperty objects to the collection.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v18.2.dll

Declaration

public void AddRange(
    ViewProperty[] sortProperties
)

Parameters

Name Type Description
sortProperties ViewProperty[]

An array of ViewProperty objects to add to the collection.

Remarks

To add a single element to the collection use the ViewPropertiesCollection.Add method.

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