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

Appointment Sort Order

15 Answers 183 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 18 Aug 2010, 11:14 AM
Hi there

How do I modify the order in which appointments are displayed within a Scheduler?

I have set the EventProvider Sort property to the name of the data column I want to sort by, but it does not seem to change what is displayed in the control

Thanks
Andy

15 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 20 Aug 2010, 07:50 AM
Hi Andy,

Thank you for writing to us.

At the moment the appointments in the timeline view are sorted only by start date, end date, and the period of the appointment. Unfortunately, we do not provide functionality for custom sorting. Our team might consider implementing it in a future release, but for now we have not scheduled such a task. 

I hope you find the above information useful. Let me know if I can assist you further. 

Regards,
Dobry Zranchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andy
Top achievements
Rank 1
answered on 23 Aug 2010, 04:51 PM
Hi there

As an interim measure, we can modify the start date of the appointment - amending the milliseconds amount depending on what order we want should work.
However, I cannot seem to find a databind event for appointments in the Scheduler; so I don't see where I can make changes to the values at bind time.
How can I programtically change the values that an appointment is bound by, do you use some other solution than Bind events?

I looked at the SchedulerMapping object, but the example given does not seem to be a complete one. Is this going to be the best solution? If so, can you provide me with a complete example?

Thanks
0
Jack
Telerik team
answered on 26 Aug 2010, 07:23 PM
Hello Andy,

As my colleague said we do not support this scenario in the current version of RadScheduler. There is no event which indicates that the binding process is finished. However, you can do this after setting the DataSource property or at the end of the OnLoad event for the form. You can modify the desired appointment by using this code:

Appointment appointment = (Appointment)this.radScheduler1.Appointments[0];
appointment.Start = appointment.Start.AddMilliseconds(10);

I will inform you when we find a solution for the issue. If you have any other questions, please do not hesitate to ask.

 

Regards,
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dobry Zranchev
Telerik team
answered on 30 Aug 2010, 01:02 PM
Hi Andy,

The purpose of this message is to inform you that we are going to add an event which will be fired after the DataBinding process is finished and the data is loaded in the scheduler. You can track the status of this feature request here.

Feel free to write back for further questions.

Sincerely yours,
Dobry Zranchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Karl
Top achievements
Rank 1
answered on 27 Jul 2012, 11:38 AM
I've just tried to view the PITS article that refers to this, but its not visible and I get an almost blank screen.

However we also require custom sorting in our Scheduler control (timelive view). We're writing a booking system and want to be able to double book resources, but show them in the order they were booked, not the start times or alphabetically.

I can only imagine this to be a positive enhancement to the control, and it looks like its already in the ASP.Net version. Please can we have the same custom sorting added to the Winforms Scheduler control?
0
Ivan Todorov
Telerik team
answered on 30 Jul 2012, 03:45 PM
Hello Karl,

The PITS link seems to be working, but it takes some time before it is loaded. However, it only says that we have added the DataBindingComplete events. The idea discussed in this thread is to handle this event and modify the Milliseconds part of the Start date of the appointments so that they are sorted in the desired order (currently the appointments are only sorted according to their Start date). However, you said that you need to display them in the order they were added. In this case you can keep some sort of global counter which will be incremented with every appointment you add and will be set as the Milliseconds part of the Start date of the newly added appointment.

As to providing a way to set custom sorting, we will consider adding such feature in one of the next releases. It has been logged in PITS as a feature request. You can subscribe to it to track it for changes and vote for it to increase its priority. The PITS item can be found on this URL.

I hope this helps. If you have additional questions, do not hesitate to ask.

Greetings,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Mohammed
Top achievements
Rank 1
answered on 19 Jul 2016, 10:16 AM

Hi,

I need to provide a custom order to display my appointments... EG Put the user appointments at the top... at the moment, the default order is based on time.  Is there yet a way to implement custom sort orders of the appointments in the various views?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Jul 2016, 11:02 AM
Hello Mohammed,

Thank you for writing. 

We had a feature request for custom sorting in RadScheduler when the start date and duration of the appointments are equal. It has already addressed. Here is the feedback item for your reference: http://feedback.telerik.com/Project/154/Feedback/Details/111320-add-custom-sorting-for-the-appointments-in-radscheduler-added-the-appointments

You can create a custom comparer that implements the IComparer<AppointmentElement> interface and the appointments according to your requirement.
this.radScheduler1.AppointmentsComparer = new MyComparer();

public class MyComparer : IComparer<AppointmentElement>
{
    public int Compare(AppointmentElement x, AppointmentElement y)
    {
        return x.Appointment.Summary.Length.CompareTo(y.Appointment.Summary.Length);
    }
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Mohammed
Top achievements
Rank 1
answered on 19 Jul 2016, 11:48 AM

Hi Dess,

Thanks for the reply.  I have implemented your suggestion, but unfortunately without success.  The comparer only ever has the same objects passed to it for both x and y... very strange... Eg. I have many appointments with various dates...  Breakpoint 1 is hit at every compare, just to prove it is working, but If I put a breakpoint at breakpoint 2 it is never hit.  When I look further into this (hence why I created this IF statement), both x and y are always the same values.

Could you advise why this would be the case?

    public class ShiftAndCandidateAppointmentComparer : IComparer<AppointmentElement>
    {
        public int Compare(AppointmentElement x, AppointmentElement y)
        {
// Breakpoint 1

            if (x.Start != y.Start) 
            {

// Breakpoint 2
                var a = 1;
            }
}

}

0
Mohammed
Top achievements
Rank 1
answered on 19 Jul 2016, 11:53 AM
ps - this example is not complete with return of int etc... it's just a demo of the comparison on equivalent objects.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Jul 2016, 11:53 AM
Hello Mohammed,

Thank you for writing back. 

The Compare method is supposed to be triggered for appointments that have exactly the same start time and duration as it provides custom sorting logic for identical appointments. If the method is always triggered for equal x AppointmentElements on your end, this means that you don't have equal appointments (equal start time and duration).
 
I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Mohammed
Top achievements
Rank 1
answered on 19 Jul 2016, 12:05 PM

Ah, that makes sense.  I need to dictate the order of the appointments regardless of their time of day...  I have two types of appointment on display... One type is showing the unavailability of a candidate (lets say these are blue) and the other type shows the shifts available (lets say orange).  I need to show all the blue appointments at the top, regardless of their start times.  

At the moment I get a mix of blue and orange appointments mixed throughout the day on the shecdule.

Is there anything I can do to acheive this ordering?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Jul 2016, 08:02 AM
Hello Mohammed,

Thank you for writing back. 

RadScheduler is a control that is designed to arrange appointments according to the time frame they occupy. It is not supposed to move appointments to different time slots according to custom sort logic. I would recommend you to have a look at our RadGridView control which supports custom sorting for its columns according to your own sorting logic. Thus you can style the cells in a specific column to simulate the appointments  and sort them according to your requirement. 

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Srivalli
Top achievements
Rank 1
answered on 19 Aug 2016, 01:00 PM

Hi,

I have a requirement in which I should bind the appoinments based on the order, following is the example

Service1                          Service2                        Service3

7am to 10pm                   7am to 10pm         7am to 10pm

Can  you please help me on grouping and binding the appointments. 

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Aug 2016, 10:51 AM
Hello Srivalli,

Thank you for writing. 

Following the provided approach from my post on 19-Jul-2016 2:02:44 PM, you can achieve the required order by implementing your own IComparer where the Compare method must return an integer result to control the order. Thus, the custom sorting in RadScheduler will be applied when the start date and duration of the appointments are equal. 

As to the binding question, please refer to the Scheduler >> Data Binding section in the online documentation: http://docs.telerik.com/devtools/winforms/scheduler/data-binding/introduction

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
Scheduler and Reminder
Asked by
Andy
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
Andy
Top achievements
Rank 1
Jack
Telerik team
Karl
Top achievements
Rank 1
Ivan Todorov
Telerik team
Mohammed
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Srivalli
Top achievements
Rank 1
Share this question
or