HighlightedMemberAttribute Class
When applied to a data source member, includes the corresponding item in the list of highlighted data members in the Data Source Wizard.
Namespace: DevExpress.DataAccess.ObjectBinding
Assembly: DevExpress.DataAccess.v24.1.dll
NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap
Declaration
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class HighlightedMemberAttribute :
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.
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);
}
}
}
// ...
}