The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.2.dll

Declaration

[TypeConverter(typeof(EditOptionsReadOnlyConverter))]
[XtraSerializableProperty]
public bool ReadOnly { get; set; }
<TypeConverter(GetType(EditOptionsReadOnlyConverter))>
<XtraSerializableProperty>
Public Property ReadOnly As Boolean

Property Value

Type Default Description
Boolean

false

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

Remarks

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