Use Spreadsheet Documents in Business Objects
- 2 minutes to read
Note
XAF does not support the Spreadsheet editor for ASP.NET Core Blazor applications.
This topic describes how to use the SpreadsheetPropertyEditor and ASPxSpreadsheetPropertyEditor to display byte array properties in WinForms and ASP.NET Web Forms 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:
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.
In the Model Editor
Navigate to the Views | <DetailView> | Items | <PropertyEditor> node and set the PropertyEditorType property to DevExpress.ExpressApp.Office.Win.SpreadsheetPropertyEditor or DevExpress.ExpressApp.Office.Web.ASPxSpreadsheetPropertyEditor.
Edit the Document in a Separate Window
Use the Show in popup context menu command to open the document in a new modal window.
In ASP.NET Web Forms applications, you can edit the document in full-screen mode.