Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Collapse]Business Model Design
    Business Model Design Basics
    Built-in Business Classes for Most Popular Scenarios
   [Expand]Business Model Design with Entity Framework
   [Expand]Business Model Design with XPO
    Non-Persistent Objects
    PropertyChanged Event in Business Classes
   [Collapse]Data Types Supported by built-in Editors
     Key Properties
    [Expand]String Properties
    [Expand]Numeric Properties
    [Expand]Date and Time Properties
    [Expand]Boolean Properties
    [Expand]BLOB Image Properties
    [Expand]Collection Properties
    [Expand]Reference (Foreign Key, Complex Type) Properties
    [Collapse]File Attachment Properties
      File Attachment Properties in XPO
      File Attachment Properties in Entity Framework
      File Attachment Properties in Domain Components
    [Expand]Type Properties
    [Expand]Enumeration Properties
    [Expand]Criteria Properties
    [Expand]Color Properties
     Geolocation Properties
     Miscellaneous Property Types
    Mapping Complex Types to the Database
   [Expand]Types Info Subsystem
    Connect an XAF Application to a Database Provider
    Data Annotations in Data Model
    Create and Update the Application's Database
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

File Attachment Properties

In XAF, the BLOB file attachment functionality is provided by the File Attachments Module.

The image below illustrates IFileData type business class properties.

Windows Forms

ASP.NET

Note

To see File Attachment Property Editors in action, refer to the Property Editors | File Attachment Properties section in the Feature Center demo installed with XAF. By default, the Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 17.1\Components\eXpressApp Framework\FeatureCenter. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/.

Expanded Examples

Expanded Windows Forms Property Editors for File Attachment Properties

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. The table below shows both the control and repository item.

Property Editor Type and Description Control Repository Item

FileDataPropertyEditor

Used for properties of the types that implement the IFileData interface by default. For instance, the FileData type is a built-in type that implements this interface.
This Property Editor is contained in the File Attachments Module. When this module is added to a Windows Forms application, this Property Editor is used.
The Open, SaveTo and ClearContent Actions, which you can perform with the editor, represent FileAttachmentController Actions. To execute these Actions, use the editor's context menu. The Open Action can also be executed by clicking the editor's button or pressing Enter.
FileDataEdit - a descendant of the ButtonEdit control. The OpenFileDialog is used to attach a file. RepositoryItemFileDataEdit - a descendant of the RepositoryItemButtonEdit repository item from the XtraEditors Library

Expanded ASP.NET Property Editors for Image Properties

Each ASP.NET Property Editor has controls that display a property in a Detail View's View mode and in an Edit mode (see DetailView.ViewEditMode). These controls are listed in the table below.

Property Editor Type and Description

Control Used in a View Mode

Control Used in an Edit Mode

FileDataPropertyEditor

Used for properties of the types that implement the IFileData interface by default. For instance, the FileData type is a built-in type that implements this interface.
This Property Editor is contained in the File Attachments Module. When this module is added to an ASP.NET application, this Property Editor is used.
Generally, the FileDataPropertyEditor uses only the FileDataEdit control, which is generated in differently for view, edit and read-only modes.
In a view mode, the file representing the property's value is displayed via a link and can be downloaded. The Download operation represents the FileAttachmentController's Download Action.
In an edit mode, the Edit and Clear operations are added to the download operation.
In the current implementation of the FileDataPropertyEditor, the upload progress will not be shown in case the ImmediatePostDataAttribute is applied to the current FileData property or the IModelCommonMemberViewItem.ImmediatePostData option is enabled in the Model Editor for the current View Item.
FileDataEdit control which uses the HtmlAnchor control to download the current file in a view mode. FileDataEdit control which uses the HtmlAnchor control to download the current file and the ASPxUploadControl to upload a new file in an edit mode. The Change File and Clear buttons are displayed using two ASPxButton controls.

How would you rate this topic?​​​​​​​