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

HighlightedClassAttribute Class

When applied to a class, includes the corresponding item in the list of highlighted classes in the Data Source Wizard.

Namespace: DevExpress.DataAccess.ObjectBinding

Assembly: DevExpress.DataAccess.v20.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.WindowsDesktop.DataAccess

Declaration

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class HighlightedClassAttribute :
    Attribute

Example

To highlight a specific class or data member in an ObjectDataSource, use the HighlightedClassAttribute and HighlightedMemberAttribute.

This requires adding a reference to the DevExpress.DataAccess.ObjectBinding namespace that resides within the DevExpress.DataAccess assembly.

data-access-object-binding-add-reference

In the Reference Manager that is invoked, switch to the Extensions tab, select the appropriate version of the DevExpress.DataAccess assembly and click OK.

The following code illustrates the use of these attributes in the data source class definition.

using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using DevExpress.DataAccess.ObjectBinding;
// ...

[DisplayName("Fishes")]
[HighlightedClass]
public class Fishes : List<Fish> {
    [HighlightedMember]
    public Fishes(string filePath) {
        if(File.Exists(filePath)) {
            using(Stream stream = File.OpenRead(filePath)) {
                this.LoadFrom(stream);
            }
        }
    }
// ...
}

Inheritance

Object
Attribute
HighlightedClassAttribute
See Also