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.