EditOptions.ReadOnly Property

Specifies whether an editor for customizing a control's content in Print Preview is enabled.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.1.dll

Syntax

public bool ReadOnly { get; set; }

Returns

Type Description
Boolean

true, to prohibit editing a control's content in Print Preview; otherwise, false.

You can enable content editing for a report control by setting the EditOptions.Enabled property to true. This results in one or more corresponding editing fields being added to the PrintingSystemBase.EditingFields collection.

When the ReadOnly property is enabled, a corresponding field cannot be edited in Print Preview and is not highlighted as an editing field. The following code illustrates how to use this property to disable content editing for a specific user.

using DevExpress.XtraPrinting;
// ...

private void XtraReport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
    PrintingSystem.AfterBuildPages += PrintingSystem_AfterBuildPages;
}

private static string userName = System.Environment.UserName;

void PrintingSystem_AfterBuildPages(object sender, System.EventArgs e) {
    if (userName == "fuller.andrew")
        foreach (EditingField field in PrintingSystem.EditingFields)
            field.ReadOnly = true;
}

For more information, see Content Editing in Print Preview.

See Also