ListEditorAttribute Class
Registers a custom List Editor in the Application Model.
Namespace: DevExpress.ExpressApp.Editors
Assembly: DevExpress.ExpressApp.v25.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Remarks
When an XAF application loads, the reflection mechanism locates classes with the ListEditor attribute. The Application Model includes these classes into its List Editor collection. The attribute’s parameter specifies the target object type for the List Editor.
Tip
Use the PropertyEditorAttribute to register a class as a Property Editor.
The ListEditor attribute includes the following parameters:
listElementType- Sets the type of objects that the List Editor can display. Set this parameter to Object to support objects of any type.
isDefault- Specify
trueto make this List Editor a default choice for the specified object type(s). Otherwise, the List Editor is available in the Model Editor, but you must explicitly assign it to an object type or a List View.
Use Your Custom Class as the Default List Editor
You can specify the default List Editor in two ways:
- In code
Apply
ListEditorAttributeto your custom List Editor class. Pass Object andtrueas attribute parameters.// Set CustomListEditor as the default List Editor [ListEditor(typeof(object), true)] public class CustomListEditor : DxGridListEditor { /* ... */ }- In the Model Editor
Use
ListEditorAttributeto register your custom List Editor in the Application Model. Pass Object andfalseas attribute parameters.// Register CustomListEditor as the available List Editor for properties of any type [ListEditor(typeof(object), false)] public class CustomListEditor : DxGridListEditor { /* ... */ }Open the Model Editor, select Views, and set the DefaultListEditor property to your editor class name.

Assign Your Custom List Editor to a Specific Object Type
You can link a custom List Editor to a specific type in the following two ways:
- In code
Apply
ListEditorAttributeto your editor class. Pass the required data type andtrueas attribute parameters.// Assign CustomListEditor to Employee object type [ListEditor(typeof(Employee), true)] public class CustomListEditor : DxGridListEditor { /* ... */ }- In the Model Editor
Use
ListEditorAttributeto register your custom List Editor in the Application Model. Pass the required data type andfalseas attribute parameters.// Register CustomListEditor as the available list editor for Employee objects [ListEditor(typeof(Employee), false)] // Or Register CustomListEditor as the available List Editor for properties of any type //[ListEditor(typeof(object), false)] public class CustomListEditor : DxGridListEditor { /* ... */ }To assign this editor to a specific object type, open the Model Editor and select BOModel | {MySolution}.Module.BusinessObjects | {ClassName}. Set the EditorType property to your editor class name.

Assign Your Custom List Editor to a List View Item
Register the editor in code as demonstrated in the previous section. In the Model Editor, select Views | {MySolution}.Module.BusinessObjects | {ClassName} | {ClassName}_ListView. Set the EditorType property to your editor class name.

Alternative List Editor Registration Method (No Attributes)
You can disable the mechanism that locates classes decorated with ListEditorAttribute. This change may help you optimize application load time.
To activate manual List Editor registration, override the ModelBase.RegisterEditorDescriptors method. Call the RegisterListEditor method to register required List Editors:
public class CustomListEditor : DxGridListEditor { /* ... */ }
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
using MySolution.Module.BusinessObjects;
namespace MySolution.Blazor.Server {
public sealed class MySolutionBlazorModule : ModuleBase {
protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory) {
editorDescriptorsFactory.RegisterListEditor(typeof(MyBusinessObject), typeof(CustomListEditor), true);
}
//...
}
// ...
}
Refer to the ModuleBase property description for details.
Examples
- How to: Use a Custom Component to Implement List Editor (Blazor)
- How to: Implement a Custom List Editor (WinForms)