Skip to main content

DXRichEditDocumentSaveOptions.DefaultFileName Property

Gets or sets the default file name used when saving or loading a document which has not been previously saved. This is a dependency property.

Namespace: DevExpress.Xpf.RichEdit

Assembly: DevExpress.Xpf.RichEdit.v24.2.dll

NuGet Package: DevExpress.Wpf.RichEdit

Declaration

public string DefaultFileName { get; set; }

Property Value

Type Description
String

A String value representing the default file name (including the path and the file extension. )

Property Paths

You can access this nested property as listed below:

Object Type Path to DefaultFileName
RichEditControl
.DocumentSaveOptions .DefaultFileName

Remarks

The DefaultFileName property specifies a file name that will be used when saving a newly created document. The DXRichEditDocumentSaveOptions.DefaultFormat property specifies a format for saving a newly created document. The file extension for the specified file format is added automatically.

If the document has already been saved, the Document.SaveDocument method saves it to the file with the name defined in the DXRichEditDocumentSaveOptions.CurrentFileName property.

To specify a name that is suggested in the SaveAs file dialog invoked via the SaveDocumentAsCommand command, use a Custom SaveAs Command technique illustrated in the following code snippet. The “C:\Temp\SavedDocument.rtf” name is the default file name specified for the Save As dialog.

View Example

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.Export;
using DevExpress.XtraRichEdit.Services;
        public Form1() 
        {
            InitializeComponent();

            CustomRichEditCommandFactoryService commandFactory =
                new CustomRichEditCommandFactoryService(richEditControl1,
                    richEditControl1.GetService<IRichEditCommandFactoryService>());
            richEditControl1.ReplaceService<IRichEditCommandFactoryService>(commandFactory);
        }
See Also