c1Scedule (winforms) : stop the automatic ordering of appointments

Posted by: chris.moxon on 14 June 2021, 11:19 am EST

  • Posted 14 June 2021, 11:19 am EST

    Hi,

    We manually add appointments to the C1schedule control at runtime; we don’t make use of normal fields that are displayed (ie location and subject etc - though the latter is used below for illustration purposes) and most of the important data is stored in the tag field of an appointment and is displayed to the user via the tooltip.

    So, what we need to happen - is that the order we add appointments needs to be maintained and they need to be shown in the same order.

    For example, the following code adds two appointments for the same day/time with the same subject of “Test”. The only difference between the two appointments is the value in the Tag property, which is what is shown in the tooltip.

           
    newApp = Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add()
            With newApp
                .Subject = "TEST"
                .Tag = "BBBB"
                .Start = DateTime.Today
            End With
    
            newApp = Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add()
            With newApp
                .Subject = "TEST"
                .Tag = "AAAA"
                .Start = DateTime.Today
            End With
    
    

    and

       
    Private Sub C1Schedule1_BeforeAppointmentTooltipShow(sender As Object, e As C1.Win.C1Schedule.BeforeAppointmentTooltipShowEventArgs) Handles C1Schedule1.BeforeAppointmentTooltipShow
            e.Text = DirectCast(e.Appointment.Tag, String)
        End Sub
    
    

    I have written a test program (attached) that uses the above code and while I was writing/testing it; I thought I was going mad (!) - because the outcome of running can change every time - which is actually worse than I first thought. If you run the program, it adds two appointments for the same day with the same subject - so they both look identical. When you hover over them, the tooltip shows you the value in the tag property - the first one should be “BBBB”, the second “AAAA” - but some times its shown the other way round. Also if you hit the refresh button a random number of times; then sometimes the order changes around !?

    This is incredibly not good for us. We want to guarantee that whatever order we add appointments (with same start time), then they should show in that order - always and never change (unless the start time is changed).

    Please Help.

    Cheers,

    Chris.

    C1ScheduleAppOrder.zip

  • Posted 15 June 2021, 12:48 am EST

    Hi,

    We have reported the issue to the development team and will let you know when we have an update.

    [Internal Tracking ID : C1WIN-25115]

    Regards.

    Avnish

  • Posted 15 June 2021, 7:27 am EST

    Avnish,

    Thanks for the reply - hopefully they can fix it.

    Cheers,

    Chris.

  • Posted 16 June 2021, 6:42 am EST

    Hi,

    As per the development team, C1Schedule control doesn’t keep track of appointment creation order. If you want appointments sorted in a specific way, then you can implement custom comparison for that: https://www.grapecity.com/componentone/docs/win/online-schedule/C1.Win.C1Schedule.4.5.2~C1.Win.C1Schedule.C1Schedule~AppointmentComparison.html

    Please refer to the sample attached and modify it according to your requirements.

    Regards.

    Avnish

    C1ScheduleAppOrder_mod.zip

Need extra support?

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

Learn More

Forum Channels