Skip to main content

RichEditSettings Class

Contains the RichEdit extension settings.

Namespace: DevExpress.Web.Mvc

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

Declaration

public class RichEditSettings :
    SettingsBase

Remarks

To declare the RichEdit in a View, invoke the ExtensionsFactory.RichEdit helper method. This method returns the RichEdit extension that is implemented by the RichEditExtension class.

To configure the RichEdit extension, pass the RichEditSettings object to the ExtensionsFactory.RichEdit helper method as a parameter. The RichEditSettings object contains all the RichEdit extension settings.

The example below demonstrates how to prevent users from loading documents in a format other than DOCX:

@Html.DevExpress().RichEdit(settings => {
    settings.Name = "RichEdit";
    settings.CallbackRouteValues = new { Controller = "Home", Action = "RichEditPartial" };
    settings.WorkDirectory = @"~\App_Data\WorkDirectory\";  
    settings.SettingsDocumentSelector.UploadSettings.Enabled = true;
    settings.SettingsDocumentSelector.CommonSettings.AllowedFileExtensions = new String[] {".docx"};
    settings.SettingsDocumentSelector.UploadSettings.ValidationSettings.NotAllowedFileExtensionErrorText = "This file extention isn't allowed.";
}).GetHtml()

Refer to the Rich Text Editor Overview topic to learn how to add the RichEdit extension to your project.

Inheritance

Object
SettingsBase
RichEditSettings
See Also