Skip to main content

RichEditSettings.Saving Property

Allows you to implement custom saving logic.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public DocumentSavingEventHandler Saving { get; set; }

Property Value

Type Description
DocumentSavingEventHandler

A method to which custom processing is delegated.

Remarks

Handle the Saving event to save a document in a custom manner. A custom implementation is required when Rich Text Editor does not have enough information to complete the document save operation automatically. Such situations occur when the control is about to save a new document or a document opened from a custom document storage.

The event argument’s e.DocumentID property identifies the document to be saved. Implement custom logic and set the e.Handled property to true to disable the built-in save routine. If it is disabled but the handler includes no custom save procedure implementation, the save operation throws an exception.

View Example: Rich Text Editor for ASP.NET MVC - How to open and save documents from a database

settings.Saving = (s, e) => {
    byte[] docBytes = RichEditExtension.SaveCopy("RichEditName", DevExpress.XtraRichEdit.DocumentFormat.Rtf);
    DXWebApplication1.Models.DataHelper.SaveDocument(docBytes);
    e.Handled = true;
};
See Also