JS

RichEditBuilder.Open(Func<Byte[]>, DocumentFormat) Method

Opens a document specified by an array of bytes.

Namespace: DevExpress.AspNetCore.RichEdit

Assembly: DevExpress.AspNetCore.RichEdit.v21.1.dll

Declaration

public RichEditBuilder Open(
    Func<byte[]> contentAccessorByBytes,
    DocumentFormat format
)

Parameters

Name Type Description
contentAccessorByBytes Func<Byte[]>

A method delegate to obtain a byte array from which to open the document.

format DocumentFormat

An object specifying the document format.

Returns

Type Description
RichEditBuilder

A RichEditBuilder that can be used to further configure the Rich Text Editor.

Remarks

<script>
    function SaveRichDocument(data) {
        richEdit.save();
    }
</script>
<button type="button" class="btn btn-primary" onclick="SaveRichDocument()">Save</button>

@(Html.DevExpress().RichEdit("richEdit")
    .Width("100%")
    .Height(800)
    .Ribbon(ribbon => ribbon
        .ActiveTabIndex(0)
    )
    .ExportUrl(Url.Action("SaveAction"))
    .Open(() => { return Model.ContentAccessorByBytes; }, DevExpress.AspNetCore.RichEdit.DocumentFormat.OpenXml)
) 
See Also