This is a migrated thread and some comments may be shown as answers.

Ordering of Appointments?

8 Answers 147 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Scott Ellison
Top achievements
Rank 1
Scott Ellison asked on 14 Jul 2008, 02:34 PM
It appears appointments are ordered on the RadScheduler based on the Start of the appointment.  Is there anyway to override this and force it to order via another attribute/property?  

For example, I have 3 appointments on the Scheduler, and I always want Appointment #2 to display at the top (within that resources row obviously).

Thanks in advance.

8 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 15 Jul 2008, 07:32 AM
Hi Scott,

Currently, we are not exposing any property that can be used to influence the appointment ordering. We realize that such feature will be very useful and easy to implement, so we have decided to include it in the Q2 release.

We will expose a property of type IComparer<Appointment>, so you will be able to easily change the ordering by implementing a custom comparer class.

Thank you for the good suggestion. Your Telerik points have been updated for your involvement.

The release is scheduled for the next week.

Regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott Ellison
Top achievements
Rank 1
answered on 15 Jul 2008, 12:27 PM
Awesome - this is very helpful.  Thanks!
0
JeffN
Top achievements
Rank 1
answered on 06 Aug 2008, 12:32 PM
I am now using your Q2 2008 release and I am attempting to sort the appointments for a resource using a custom comparer class that I have written. When the list of Appointments is returned from the Provider, they are in the order that I want them to be in (custom order, not ordered by the Appointment's Start Time). BUT, when bound, they seem to revert to their default sort (Start Time). When I debug within the AppointmentCreated event handler, it is being called for Appointments based on this Start Time instead of the order that I had the list sorted by.

I'm not sure if I am missing something or if behind the scenes, this Appointment list is being re-sorted by the default, Start Time, field.

Thanks in advance for any help!
0
T. Tsonev
Telerik team
answered on 06 Aug 2008, 12:40 PM
Hi Jeff,

You are correct, RadScheduler reorders the appointments by start time before rendering them. You can influence the order of appointments within a single time slot by assigning an instance of your comparer class to the AppointmentComparer property.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JeffN
Top achievements
Rank 1
answered on 06 Aug 2008, 04:06 PM
Thank you! That got me halfway there. The appointments are now sorted properly before rendering, they're even passing through the "OnAppointmentCreated" event in the proper order. BUT, when they're rendered, they're still in the incorrect order.

So, I have 3 appointments that I want rendered in this order: 1, 2, 3. With a breakpoint in the OnAppointmentCreated event, I see that it is called first for appt 1, then 2, then 3 (correctly). When it renders though, I see appt 2 at the top, then 1, then 3.

Any idea why this is occurring?
0
T. Tsonev
Telerik team
answered on 07 Aug 2008, 04:20 PM
Hi JeffN,

Can you please send us the exact time of the appointments?

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JeffN
Top achievements
Rank 1
answered on 07 Aug 2008, 04:40 PM
The times of the 3 appointments in my situation are:

7am - 5pm
9am - 5pm (this is the one that I'd like to be first, and is before being rendered, but it's being rendered as the second)
2pm - 3pm

I'm putting together a small, sample app now that will demonstrate this.

Thanks!
0
T. Tsonev
Telerik team
answered on 08 Aug 2008, 04:27 PM
Hi Jeff,

Unfortunately, this is not possible with the current layout algorithm. Currently, we always place the appointments starting earlier to the left. The comparer can still influence the rendering, but only to some extent. We will consider if we can use the comparer to influence the ordering even further, but we need to research if this is not going to cause harmful side-effects.

All the best,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Scott Ellison
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Scott Ellison
Top achievements
Rank 1
JeffN
Top achievements
Rank 1
Share this question
or