expressappframework-400931-document-management-office-module-use-spreadsheet-documents-in-business-objects.md
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:
Decorate a business class’ property with the EditorAliasAttribute and pass the SpreadsheetPropertyEditor value as the attribute’s parameter:
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.
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); }
}
Navigate to the Views | <DetailView> | Items | <PropertyEditor> node and set the PropertyEditorType property to DevExpress.ExpressApp.Office.Win.SpreadsheetPropertyEditor.
Use the Show in popup context menu command to open the document in a new modal window.
See Also