corelibraries-devexpress-dot-dataaccess-dot-objectbinding-986259bc.md
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.v25.2.dll
NuGet Package : DevExpress.DataAccess
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class HighlightedMemberAttribute :
Attribute
<AttributeUsage(AttributeTargets.Constructor Or AttributeTargets.Method Or AttributeTargets.Property, AllowMultiple:=False, Inherited:=False)>
Public NotInheritable Class HighlightedMemberAttribute
Inherits Attribute
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);
}
}
}
// ...
}
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.IO
Imports DevExpress.DataAccess.ObjectBinding
' ...
<DisplayName("Fishes"), HighlightedClass> _
Public Class Fishes
Inherits List(Of Fish)
<HighlightedMember> _
Public Sub New(ByVal filePath As String)
If File.Exists(filePath) Then
Using stream As Stream = File.OpenRead(filePath)
Me.LoadFrom(stream)
End Using
End If
End Sub
' ...
End Class
Object Attribute HighlightedMemberAttribute
See Also