Control UI

Posted by: harrisona on 9 September 2017, 8:29 am EST

  • Posted 9 September 2017, 8:29 am EST

    Is it possible to control the Scheduler UI from code?

    For instance if I want to stop users from editing an occurrence of a series of appointments, could I remove the 'edit occurence' option?
  • Replied 9 September 2017, 8:29 am EST

    UI WinForms Control, http://www.kettic.com/winforms_ui/
  • Replied 9 September 2017, 8:29 am EST

    I am trying to edit the Event booking window. I would like to remove the 'Reminder' and the 'Show time as' sections out of the window. Any suggestions how i might be able to get this done?
  • Replied 9 September 2017, 8:29 am EST

    Hello AndrewRobinson,

    Apologies in delay in response.

    Could you please look at the following post and let me know if this helps :
    http://our.componentone.com/groups/topic/override-new-appointment-popup/

    Thanks,
    Richa
  • Replied 9 September 2017, 8:29 am EST

    Hello Harrisona,

    You cannot remove edit occurrence option. However, you may disable editing of an appointment in a recurring appointment in UserEditingAppointment by using a code as follows :
    partial void Calendar_Created()
    {
    // Write your code here.
    IContentItemProxy _proxy = this.FindControl("C1Scheduler");
    _proxy.ControlAvailable += _proxy_ControlAvailable;

    }
    C1Scheduler scheduler;
    void _proxy_ControlAvailable(object sender, ControlAvailableEventArgs e)
    {
    scheduler = e.Control as C1Scheduler;
    scheduler.UserEditingAppointment += (s,ea)=>
    {
    C1.C1Schedule.Appointment app = ea.Appointment;
    C1.C1Schedule.AppointmentList alist = scheduler.DataStorage.AppointmentStorage.Appointments.GetOccurrences(app, new DateTime(2012, 7, 17), new DateTime(2012, 7, 18));
    if (alist.Contains(app))
    {
    // ap.CancelEdit();
    ea.Handled = true;
    }

    };
    }


    This code will disable editing of an occurrence which falls on 17 July, 2012.

    Thanks,
    Richa
  • Replied 9 September 2017, 8:29 am EST

    Hello Harrisona,

    If you wish to disable the inplace editing of the appointment as well, then you can toggle the 'IsInPlaceEditingDisabled' property to False in the if code block as :
    void _proxy_ControlAvailable(object sender, ControlAvailableEventArgs e)
    {
    scheduler = e.Control as C1Scheduler;
    scheduler.UserEditingAppointment += (s,ea)=>
    {
    C1.C1Schedule.Appointment app = ea.Appointment;
    C1.C1Schedule.AppointmentList alist = scheduler.DataStorage.AppointmentStorage.Appointments.GetOccurrences(app, new DateTime(2012, 7, 17), new DateTime(2012, 7, 18));
    if (alist.Contains(app))
    {
    ea.Handled = true;
    scheduler.IsInPlaceEditingDisabled = true;
    }
    else
    scheduler.IsInPlaceEditingDisabled = false;

    };
    }


    Thanks,
    Richa
  • Replied 9 September 2017, 8:29 am EST

    Can we have this code in VB?
  • Replied 9 September 2017, 8:29 am EST

    Hello,

    Here is the code in VB :

     Public Class Calendar
    Dim scheduler As C1.Silverlight.Schedule.C1Scheduler

    Private Sub Calendar_Created()
    ' Write your code here.
    Dim proxy As IContentItemProxy = Me.FindControl("C1Scheduler")

    AddHandler proxy.ControlAvailable,
    Sub(s As Object, e As ControlAvailableEventArgs)
    scheduler = TryCast(e.Control, C1.Silverlight.Schedule.C1Scheduler)
    If scheduler IsNot Nothing Then
    AddHandler scheduler.UserEditingAppointment, AddressOf scheduler_UserEditingAppointment
    End If
    End Sub

    End Sub

    Private Sub scheduler_UserEditingAppointment(sender As Object, e As C1.Silverlight.Schedule.AppointmentActionEventArgs)
    Dim app As C1.C1Schedule.Appointment = e.Appointment
    Dim alist As C1.C1Schedule.AppointmentList = scheduler.DataStorage.AppointmentStorage.Appointments.GetOccurrences(New Date(2014, 12, 10, 7, 45, 0), New Date(2014, 12, 10, 8, 15, 0))
    If alist.Contains(app) Then
    e.Handled = True
    scheduler.IsInPlaceEditingDisabled = True
    Else
    scheduler.IsInPlaceEditingDisabled = False
    End If
    End Sub

    End Class


    Hope it helps.

    Regards,
    Reema
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels