Skip to main content
.NET Framework 4.6.2+

CollectionSourceBase.DisplayableProperties Property

Provides access to the semicolon-delimited list of the CollectionSourceBase.Collection‘s Property Descriptors and/or expressions.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public string DisplayableProperties { get; set; }

Property Value

Type Description
String

A semicolon-delimited list of the collection’s property descriptors and/or expressions.

Remarks

The example below illustrates how to set the DisplayableProperties property’s value. Create a custom Controller and access the property from the OnActivated method and from the ListView.CustomizeDisplayableProperties event handler.

using System;
using System.Collections.Generic;
using DevExpress.ExpressApp;
//...
public class MyViewController : ObjectViewController<ListView, Customer> {
    private List<string> additionalDisplayableProperties = 
        new List<string>() { "LocationContext.Flag", "LocationContext.Location.EntityNumberGenerationType" };
    protected override void OnActivated() {
        base.OnActivated();
            View.CollectionSource.DisplayableProperties = 
                GetUpdatedDisplayableProperties(View.CollectionSource.DisplayableProperties);
            View.CustomizeDisplayableProperties += View_CustomizeDisplayableProperties;
    }
    private void View_CustomizeDisplayableProperties(object sender, 
    CustomizeDisplayablePropertiesEventArgs e) {
        e.DisplayableProperties = GetUpdatedDisplayableProperties(e.DisplayableProperties);
    }
    private string GetUpdatedDisplayableProperties(string displayableProperties) {
        String result = displayableProperties;
        IList<String> displayablePropertiesList = displayableProperties.Replace("[", "").Replace("]", "").Split(';');
        foreach(string propertyName in additionalDisplayableProperties) {
            if(!displayablePropertiesList.Contains(propertyName)) {
                result = result + ";" + propertyName;
            }
        }
        return result;
    }
    protected override void OnDeactivated() {
        View.CustomizeDisplayableProperties -= View_CustomizeDisplayableProperties;
        base.OnDeactivated();
    }
}

Note

If the passed property name conflicts with a function name, wrap the name in square brackets (e.g. “Oid;[Count];Price”). If you subsequently need to access such a property via a data record, you do not need to use brackets.

See Also