商信互联
本主题介绍如何使用SpreadsheetPropertyEditor和ASPxSpreadsheetPropertyEditor在WinForms和ASP.NET应用程序中显示字节数组属性。下图演示了分配给Document.Data属性的这些属性编辑器:
WinForms应用程序中的SpreadsheetPropertyEditor
ASP.NET应用程序中的ASPxSpreadsheetPropertyEditor
使用EditorAliasAttribute装饰业务类的属性,并将SpreadsheetPropertyEditor值作为该属性的参数传递:
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); }
}
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
' ...
Private fData() As Byte
<EditorAlias(EditorAliases.SpreadsheetPropertyEditor)> _
Public Property Data() As Byte()
Get
Return fData
End Get
Set(ByVal value As Byte())
SetPropertyValue(NameOf(Data), fData, value)
End Set
End Property
导航到视图| <DetailView> | 物品| <PropertyEditor>节点,并将PropertyEditorType属性设置为DevExpress.ExpressApp.Office.Win.SpreadsheetPropertyEditor或DevExpress.ExpressApp.Office.Web.ASPxSpreadsheetPropertyEditor。
使用“在弹出菜单中显示上下文”菜单命令在新的模式窗口中打开文档。
在ASP.NET应用程序中,您可以在全屏模式下编辑文档。