C1Schedule : How to show and highlight an appointment in code

Posted by: chris.moxon on 5 July 2021, 12:33 pm EST

    • Post Options:
    • Link

    Posted 5 July 2021, 12:33 pm EST

    Hi,

    We are populating a C1Schedule control in code (ie it’s not bound to a data source) with appointments and I need to know how to jump to a particular appointment and highlight it in some way (maybe change its colour etc).

    For example, say we have 100 appointments in the datastorage and we know we want to show appointment saved in position/index = 73:

    Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Item(73)

    so we need this appointment to be shown in the Schedule and say highlighted in green.

    I know I can use the GotoDate function to go to a particular date - but we may have multiple appointments all on the same day (or in fact for the same time too) - so we not only need to go to the date, but the actual appointment (in pos 73) and then highlight it, so the user can see it stand out in some way.

    Hope someone can help ?

    Cheers,

    Chris.

  • Posted 6 July 2021, 4:49 am EST

    Hello Chris,

    You can handle the BeforeAppointmentFormat event to format the appointment and SelectedAppointments property and the GoToDate method to jump to that appointment.

    Please find the attached sample implementing the same.

    Regards,

    Prabhat Sharma.

    Schedule_Demo.ConvertedToVBNet.zip

  • Posted 6 July 2021, 6:33 am EST

    Prabhat Sharma - Many thanks for the speedy and brilliant response !!

  • Posted 4 August 2021, 12:16 pm EST

    Hi,

    Spooky nearly a month since I was happy with the demo that Prabhat gave me in answering my question - but today, I’m not so happy !! If you change the demo code above to show Week View instead of Month View AND you run the program after 6:00am (so if I run it now - all the appointments are added at 17:16) the appointments will not be visible on the screen (I would have to maximise it AND scroll down to see appointments) - so when I hit the button - it still randomly selects an appointment; “goes” to that date and highlights it in green - BUT I can’t see it (unless I go scrolling for it) - all I see is the big blue cursor block going into the top “cell” of the day of the appointment (see attached - the randomly selected appointment is on 14th October) . I really want the schedule to automatically scroll to the desired appointment and show it

    Is this possible ?

    Cheers,

    Chris.

  • Posted 6 August 2021, 2:24 am EST

    Hello Chris,

    We are discussing this with the developers and will get back to you with the updates soon.

    [Internal Tracking ID: C1WIN-25431]



    Regards,

    Prabhat Sharma.

  • Posted 9 August 2021, 5:08 am EST

    Hello Chris,

    You can use the EnsureVisibleTime method of C1Schedule to scroll to a particular appointment. Please find the attached sample implementing the same.

    Regards,

    Prabhat Sharma.

    Schedule_Demo (2).zip

  • Posted 9 August 2021, 6:03 am EST

    Prabhat - many thanks (again) for your help here.

Need extra support?

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

Learn More

Forum Channels