remove "Edit page" button in the preview mode

serifelsenserifelsen Unknown
edited 1:24AM in FastReport .NET
Hi

i want to remove "Edit page" button in the preview mode because this button allows user to edit data. (FastReport .NET)

thanks in advance

Comments

  • serifelsenserifelsen Unknown
    edited 1:24AM
    serifelsen wrote: »
    Hi

    i want to remove "Edit page" button in the preview mode because this button allows user to edit data. (FastReport .NET)

    thanks in advance

    i found the solution
    FastReport.Utils.Config.PreviewSettings.Buttons = PreviewButtons.All & ~PreviewButtons.Edit;
  • edited 1:24AM
    maaa diyerdin saa heyle diyerdim daaaaa
  • edited 1:24AM
    serifelsen wrote: »
    serifelsen wrote: »
    Hi

    i want to remove "Edit page" button in the preview mode because this button allows user to edit data. (FastReport .NET)

    thanks in advance

    i found the solution
    FastReport.Utils.Config.PreviewSettings.Buttons = PreviewButtons.All & ~PreviewButtons.Edit;


    Thank you, worked perfectly!
  • edited 1:24AM
    qartal84 wrote: »
    maaa diyerdin saa heyle diyerdim daaaaa

    Looool =)
  • Hello!

    The “Edit page” button in the preview window is controlled by the PreviewButtons.Edit flag. To prevent users from editing the content of a prepared report in preview mode, you can disable this flag either globally via Config.PreviewSettings.Buttons or locally for a specific instance of PreviewControl:

    using FastReport;
    using FastReport.Utils;
    
    // Globally for all preview windows in the application:
    Config.PreviewSettings.Buttons = PreviewButtons.All & ~PreviewButtons.Edit;
    
    // Or for a specific PreviewControl on the form:
    previewControl1.Buttons = PreviewButtons.All & ~PreviewButtons.Edit;
    

    To preserve all other standard toolbar buttons, it is recommended to set this configuration before displaying the report (report.Show() / report.ShowPrepared())

This discussion has been closed.