Download Free Demos

Read-only Mode

In this part we want to consider read-only mode in the context of 3 situations:

1 . Read-only mode for the entire scheduler

2 . Read-only mode for the lightbox

3 . Read-only mode for specific events

Read-only Mode for Entire Scheduler

To make the entire scheduler read-only, you should set the DHXScheduler.Config.isReadonly option to true.

var sched = new DHXScheduler();
...
sched.Config.isReadonly = true;

Note, when the entire scheduler is non-editable, users can't open the lightbox.

Read-only Mode for Lightbox

To leave for users the possibility to open the lightbox but forbid any editing inside it, you should set the DHXScheduler.Config.readonly_form option to true:

var sched = new DHXScheduler();
...
sched.Config.readonly_form = true;

Read-only Mode for Specific Events

To make just specific events read-only, you should:

  • provide additional boolean property in the data model, named as 'readonly':
public class Event
 {
    public int id { get; set; }
    public string text { get; set; }
    public DateTime start_date { get; set; }
    public DateTime end_date { get; set; }
    public bool @readonly {get;set;}
  }
  • add the Readonly extension to the app:
DHXScheduler.Extensions.Add(SchedulerExtensions.Extension.Readonly);

Now, each time the user edits some event, the scheduler checks whether this event has the readonly property set to true, and if it does - forbids editing.

Was this article helpful?

Yes No