xaf-editors
XAF: Property Editors & List Editors
Built-in Property Editors
XAF automatically selects a property editor based on the .NET type.
| Data Type | Editor Alias | WinForms Class | Blazor Class |
|---|---|---|---|
string |
StringPropertyEditor |
StringPropertyEditor | StringPropertyEditor |
int, long, short |
IntegerPropertyEditor |
IntPropertyEditor | IntPropertyEditor |
decimal |
DecimalPropertyEditor |
DecimalPropertyEditor | DecimalPropertyEditor |
double |
DoublePropertyEditor |
DoublePropertyEditor | DoublePropertyEditor |
bool |
BooleanPropertyEditor |
BooleanPropertyEditor | BooleanPropertyEditor |
DateTime |
DateTimePropertyEditor |
DateTimePropertyEditor | DateTimePropertyEditor |
TimeSpan |
TimeSpanPropertyEditor |
TimeSpanPropertyEditor | TimeSpanPropertyEditor |
enum |
EnumPropertyEditor |
EnumPropertyEditor | EnumPropertyEditor |
| reference (FK) | LookupPropertyEditor |
LookupPropertyEditor | LookupPropertyEditor |
| reference (inline) | ObjectPropertyEditor |
ObjectPropertyEditor | ObjectPropertyEditor |
byte[] / image |
ImagePropertyEditor |
ImagePropertyEditor | ImagePropertyEditor |
Color |
ColorPropertyEditor |
ColorPropertyEditor | ColorPropertyEditor |
| file attachment | FileDataPropertyEditor |
FileDataPropertyEditor | FileDataPropertyEditor |
| criteria | CriteriaPropertyEditor |
CriteriaPropertyEditor | CriteriaPropertyEditor |
| HTML string | HtmlPropertyEditor |
RichTextPropertyEditor | HtmlPropertyEditor |
All alias constants: DevExpress.ExpressApp.Editors.EditorAliases
[EditorAlias] Attribute
Apply on a business class property to explicitly assign an editor:
using DevExpress.ExpressApp.Editors;
public class Product {
// Force Lookup instead of default ObjectPropertyEditor
[EditorAlias(EditorAliases.LookupPropertyEditor)]
public virtual Category Category { get; set; }
// Use a custom registered alias
[EditorAlias("MyCustomRatingEditor")]
public virtual int Rating { get; set; }
}
Common EditorAliases constants:
EditorAliases.StringPropertyEditorEditorAliases.LookupPropertyEditorEditorAliases.ObjectPropertyEditorEditorAliases.ImagePropertyEditorEditorAliases.BooleanPropertyEditorEditorAliases.DateTimePropertyEditorEditorAliases.CriteriaPropertyEditorEditorAliases.IntegerPropertyEditorEditorAliases.DecimalPropertyEditorEditorAliases.EnumPropertyEditor
You can also override per-property in the Application Model:
BOModel > <Class> > OwnMembers > <Property> > PropertyEditorType
DisplayFormat / EditMask
Configure via [ModelDefault] attribute:
using DevExpress.ExpressApp.Model;
public class Invoice {
[ModelDefault("DisplayFormat", "{0:C2}")]
[ModelDefault("EditMask", "c2")]
[ModelDefault("EditMaskType", "Numeric")]
public virtual decimal Total { get; set; }
[ModelDefault("DisplayFormat", "{0:dd MMM yyyy}")]
[ModelDefault("EditMask", "d")]
[ModelDefault("EditMaskType", "DateTime")]
public virtual DateTime InvoiceDate { get; set; }
}
EditMaskType values: Simple, RegEx, DateTime, Numeric
Alternative: set in Model Editor at Views > <View> > Items > <Property> > DisplayFormat / EditMask
Inline Detail View (ObjectPropertyEditor)
Display a related object as an embedded sub-form instead of a popup/lookup:
[EditorAlias(EditorAliases.ObjectPropertyEditor)]
public virtual Address ShippingAddress { get; set; }
In the Application Model, set the View property on the nested item to choose which DetailView template to embed.
List Editors
| Editor | Platform | Use Case |
|---|---|---|
GridListEditor |
WinForms | Default tabular grid (XtraGrid) |
DxGridListEditor |
Blazor | Default tabular grid (DxGrid) |
TreeListEditor |
WinForms | Hierarchical tree |
DxTreeListEditor |
Blazor | Hierarchical table |
ChartListEditor |
WinForms | Chart visualization |
DxChartListEditor |
Blazor | Chart visualization |
PivotGridListEditor |
WinForms | Pivot table |
SchedulerListEditor |
WinForms | Calendar/scheduling |
CategorizedListEditor |
WinForms | Grid + category tree |
Change List Editor for a View
In Application Model: Views > <ClassName>_ListView > EditorType
Or via attribute on custom editor:
[ListEditor(typeof(MyObject), isDefault: true)]
public class MyCustomListEditor : ListEditor { ... }
Customizing GridListEditor (WinForms)
using DevExpress.ExpressApp.Win.Editors;
using DevExpress.XtraGrid.Views.Grid;
public class CustomizeGridController : ObjectViewController<ListView, MyObject> {
protected override void OnViewControlsCreated() {
base.OnViewControlsCreated();
if (View.Editor is GridListEditor gridEditor) {
GridView gridView = gridEditor.GridView;
gridView.OptionsView.ShowGroupPanel = false;
gridView.OptionsBehavior.Editable = false;
gridView.Columns["Name"].Width = 200;
gridView.Columns["Name"].Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;
gridView.Columns["Name"].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
}
}
}
Customizing DxGridListEditor (Blazor)
using DevExpress.ExpressApp.Blazor.Editors;
public class CustomizeBlazorGridController : ObjectViewController<ListView, MyObject> {
protected override void OnViewControlsCreated() {
base.OnViewControlsCreated();
if (View.Editor is DxGridListEditor gridEditor) {
gridEditor.GridModel.ShowGroupPanel = false;
gridEditor.GridModel.PageSize = 50;
gridEditor.GridModel.ShowFilterRow = true;
}
}
}
ListView Customization via Application Model
IModelListView key properties:
| Property | Description |
|---|---|
EditorType |
Which list editor class to use |
DefaultSorting |
Default sort, e.g. Name Asc |
Criteria |
Default filter criteria |
AllowEdit |
Enable inline editing |
MasterDetailMode |
How detail views open |
Columns |
Per-column settings |
IModelColumn key properties:
| Property | Description |
|---|---|
Caption |
Column header text |
Width |
Column width in pixels |
Index |
Display order (0-based) |
Visible |
Show/hide column |
SortOrder |
Ascending / Descending |
GroupIndex |
Group row index (≥0 to group) |
Format |
Display format string |
PropertyEditorType |
Override editor for this column |
Source Links
- Property Editors: https://docs.devexpress.com/eXpressAppFramework/113014/ui-construction/view-items-and-property-editors/property-editors
- View Items and Property Editors: https://docs.devexpress.com/eXpressAppFramework/113610/ui-construction/view-items-and-property-editors
- List Editors: https://docs.devexpress.com/eXpressAppFramework/113189/ui-construction/list-editors
- EditorAliases API: https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Editors.EditorAliases._members
- PropertyEditorAttribute: https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Editors.PropertyEditorAttribute
- ListEditorAttribute: https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Editors.ListEditorAttribute
More from kashiash/xaf-skills
xaf
DevExpress XAF (eXpressApp Framework) master index. Use this skill first when working with any XAF topic to find the right sub-skill. Covers Blazor and WinForms, EF Core and XPO, versions v24.2 and v25.1. Sub-skills: xaf-xpo-models, xaf-ef-models, xaf-controllers, xaf-editors, xaf-custom-editors, xaf-nonpersistent, xaf-security, xaf-multi-tenant, xaf-web-api, xaf-validation, xaf-reports, xaf-dashboards, xaf-office, xaf-blazor-ui, xaf-winforms-ui, xaf-conditional-appearance, xaf-deployment, xaf-memory-leaks.
13xaf-winforms-ui
XAF WinForms UI platform - WinApplication setup, Ribbon vs Standard toolbar, WinForms-specific editors (XtraGrid, DevExpress controls), Detail View layout customization via Layout Manager, custom WinForms controls embedded in XAF views, background workers for thread-safe UI updates, splash screen customization, WinForms navigation (NavigationFrame), printing/preview in WinForms, ClickOnce/MSI deployment. Use when building or customizing XAF WinForms applications.
10xaf-blazor-ui
XAF Blazor UI platform - BlazorApplication setup in Program.cs, AddXaf/AddXafBlazor services, InvokeAsync thread safety (critical for Blazor Server), async controller actions pattern, Blazor-specific editors, embedding custom Razor components as ViewItems using IComponentContentHolder, JavaScript interop via IJSRuntime, Detail View layout customization (tabs/groups), programmatic navigation, error handling with UserFriendlyException, SignalR configuration. Use when building or customizing XAF Blazor Server applications.
10xaf-office
XAF Office/Document Management Modules - FileAttachmentsModule with IFileData/FileAttachment patterns (XPO and EF Core), SpreadsheetModule for Excel editing with ISpreadsheetValueStorage, RichTextModule for Word-like editing with IRichTextDocumentProvider and mail merge, PdfViewerModule for PDF display, platform differences (Blazor vs WinForms), programmatic document manipulation. Use when adding file attachments, spreadsheet editing, rich text editing, or PDF viewing to DevExpress XAF applications.
9xaf-reports
XAF Reports Module (XtraReports v2) - ReportsModuleV2 setup for Blazor and WinForms, report storage (DB/filesystem/custom IReportStorageWebExtension), creating predefined reports in code (PredefinedReportsUpdater), data sources (CollectionDataSource/EntityServerModeSource), report parameters, programmatic export (PDF/Excel/Word), in-app designer, PrintAction, security permissions for report design vs view. Use when working with DevExpress XtraReports integration in XAF.
9xaf-xpo-models
XAF XPO persistent object models - base classes (XPObject, XPBaseObject, XPCustomObject, BaseObject), key attributes (Persistent, Size, Indexed, Association, Aggregated), one-to-many/many-to-many/one-to-one relations, PersistentAlias calculated fields, Session access, optimistic locking, common pitfalls. Use when defining business objects with XPO ORM in DevExpress XAF.
7