FileAttachmentsWindowsFormsModule.CustomSaveFiles Event

Occurs when attached files are about to be saved to a hard disk.

Namespace: DevExpress.ExpressApp.FileAttachments.Win

Assembly: DevExpress.ExpressApp.FileAttachment.Win.v18.2.dll


public event EventHandler<CustomFileListOperationEventArgs> CustomSaveFiles
Public Event CustomSaveFiles As EventHandler(Of CustomFileListOperationEventArgs)

Event Data

The CustomSaveFiles event handler receives an argument of the CustomFileListOperationEventArgs type.


When the FileAttachmentController's SaveTo Action is executed or the file data manager's (see FileAttachmentsWindowsFormsModule.GetFileDataManager) SaveTo method is invoked, a dialog prompting the end-user to choose the destination folder is invoked. You can override this behavior by handling the CustomSaveFiles event. After manually saving the attached files data, set the handler's Handled parameter to true, to suppress display of the default dialog.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.FileAttachments.Win;
using DevExpress.Persistent.Base;
public class MyViewController : ViewController {
    FileAttachmentsWindowsFormsModule fileAttachmentsModule;
    protected override void OnActivated() {
        fileAttachmentsModule = Application.Modules.FindModule<FileAttachmentsWindowsFormsModule>();
        fileAttachmentsModule.CustomSaveFiles += fileAttachmentsModule_CustomSaveFiles;
    void fileAttachmentsModule_CustomSaveFiles(object sender, CustomFileListOperationEventArgs e) {
        foreach (IFileData fileData in e.FileDataList) {
            //manually save attached files to a disk
        e.Handled = true;
    protected override void OnDeactivated() {
        fileAttachmentsModule.CustomSaveFiles -= fileAttachmentsModule_CustomSaveFiles;
        fileAttachmentsModule = null;
See Also