Back to Devexpress

Use Spreadsheet Documents in Business Objects

expressappframework-400931-document-management-office-module-use-spreadsheet-documents-in-business-objects.md

latest2.6 KB
Original Source

Use Spreadsheet Documents in Business Objects

  • Aug 28, 2025

Note

XAF does not support the Spreadsheet editor for ASP.NET Core Blazor applications.

This topic describes how to use the SpreadsheetPropertyEditor to display byte array properties in WinForms applications. The following images demonstrate these Property Editors assigned to the Document.Data property:

Assign the Spreadsheet Property Editor to a Business Class’ Property

In Code

Decorate a business class’ property with the EditorAliasAttribute and pass the SpreadsheetPropertyEditor value as the attribute’s parameter:

csharp
using DevExpress.ExpressApp.Editors;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl.EF;
// ...
[EditorAlias(EditorAliases.SpreadsheetPropertyEditor)] 
public virtual byte[] Data { get; set; }

// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.
csharp
using DevExpress.ExpressApp.Editors;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
// ...
private byte[] data;
[EditorAlias(EditorAliases.SpreadsheetPropertyEditor)] 
public byte[] Data { 
    get { return data; }
    set { SetPropertyValue(nameof(Data), ref data, value); }
}

In the Model Editor

Navigate to the Views | <DetailView> | Items | <PropertyEditor> node and set the PropertyEditorType property to DevExpress.ExpressApp.Office.Win.SpreadsheetPropertyEditor.

Edit the Document in a Separate Window

Use the Show in popup context menu command to open the document in a new modal window.

See Also

Access the Spreadsheet Editor Controls

Customize the Spreadsheet Editors