Appointment Sort Order

16 posts, 0 answers
  1. Andy
    Andy avatar
    9 posts
    Member since:
    Aug 2010

    Posted 18 Aug 2010 Link to this post

    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
  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 20 Aug 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Andy
    Andy avatar
    9 posts
    Member since:
    Aug 2010

    Posted 23 Aug 2010 Link to this post

    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
  5. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 26 Aug 2010 Link to this post

    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
  6. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 30 Aug 2010 Link to this post

    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
  7. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 27 Jul 2012 Link to this post

    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?
  8. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 30 Jul 2012 Link to this post

    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 >>
  9. Mohammed
    Mohammed avatar
    19 posts
    Member since:
    Jan 2016

    Posted 19 Jul Link to this post

    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?

  10. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 19 Jul Link to this post

    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 compare 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.
  11. Mohammed
    Mohammed avatar
    19 posts
    Member since:
    Jan 2016

    Posted 19 Jul Link to this post

    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;
                }
    }

    }

  12. Mohammed
    Mohammed avatar
    19 posts
    Member since:
    Jan 2016

    Posted 19 Jul in reply to Mohammed Link to this post

    ps - this example is not complete with return of int etc... it's just a demo of the comparison on equivalent objects.
  13. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 19 Jul Link to this post

    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 and y 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.
  14. Mohammed
    Mohammed avatar
    19 posts
    Member since:
    Jan 2016

    Posted 19 Jul in reply to Dess Link to this post

    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?

  15. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 20 Jul Link to this post

    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.
  16. Srivalli
    Srivalli avatar
    8 posts
    Member since:
    May 2016

    Posted 19 Aug in reply to Dobry Zranchev Link to this post

    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. 

     

     

  17. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 22 Aug Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready