Version

Load a Preset

All of the WebSchedule™ controls can have presets applied to them at run-time, using the LoadPreset method. This method has several overloads, taking a the name of the preset file, and a boolean.

The boolean determines if the control will be reset before the new preset is applied.

Note
Note:

This reset will clear the WebScheduleInfoID also, and you would have to reset the WebScheduleInfo™ for the control at run-time if you apply Presets and pass in true as the boolean, at run-time.

The code snippet below shows how to apply a preset at run-time, and reset the the control, and then reset the control’s WebScheduleInfo.

WebSchedule How to Load a Preset 01.png

In Visual Basic:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e _
  As System.EventArgs) Handles MyBase.Load
        Me.WebWeekView1.LoadPreset(Me.MapPath("Onyx.xml"), True)
        Me.WebWeekView1.WebScheduleInfo = Me.WebScheduleInfo1
End Sub

In C#:

private void Page_Load(object sender, System.EventArgs e)
{
        this.WebWeekView1.LoadPreset(this.MapPath("Onyx.xml"), true);
        this.WebWeekView1.WebScheduleInfo = this.WebScheduleInfo1;
}