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

Using AppointmentComparer to Sort

3 Answers 92 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
TPerry
Top achievements
Rank 1
TPerry asked on 16 Apr 2014, 07:15 PM
I have a Scheduler that only displays All Day appointments and I'm using the AppointmentComparer to sort the entries based on Description.  This works great when the scheduler intially loads in the Month View.  But when I switch it to the Week view, the Appointments are not sorted correctly.  If I switch it back to the Month view, they are again in the incorrect order.  But if I load the page again, the appointments are sorted correctly.  The AppointmentComparer is called only on the initial load and not when I switch to the Week or Day or Month.  How can I call the AppointmentComparer when I switch Views?

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 18 Apr 2014, 05:47 AM
Hello TPerry,

I have tried to replicate the issue both locally and on our on-line demos but to no avail. Here is a video of my test. Would you please elaborate a little bit if I have to test it in a different way and share the exact steps to achieve it so we could inspect the issue one again and be more helpful with a possible solution.

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
TPerry
Top achievements
Rank 1
answered on 21 Apr 2014, 05:58 PM
Hi Plamen - both of your links shoot me to a page about Reminders??  Let me see if I can narrow down the problem.  I have a page with a Scheduler that is populated in the codebehind.  The Sub that populates it is called on PageLoad as well as when a Combobox is changed.  (I do have an Ajax Manager that updates the Scheduler when the ComboBox or the Scheduler is changed.)  Also in that code, I call the AppointmentComparer which sorts the entries.  This all works great, until I switch to Week or Day view.  The AppointmentComparer is not called (since the calendar does not need to be bound again), so the entries are no longer sorted the way I need them to be.

Code Behind Sub:
'Bind the Calendar
Me.RadScheduler1.DataSource = AttendanceBRL.EntityClasses.Calendar.GetCalendarData(IsRollUp, ID, Type, UniqueUserID)
Me.RadScheduler1.DataBind()

'Sort it
RadScheduler1.AppointmentComparer = New AttendanceBRL.BasePage.CustomAppointmentComparer("Description", SortDirection.Ascending)

Does that shed a little more light?
0
Plamen
Telerik team
answered on 23 Apr 2014, 07:11 AM
Hi TPerry,

Thank you for getting back to us and elaborating the issue.

The scenario seems quite specific and observe only in your custom case. Generally when using the AppointmentComparer we recommend using it as it is described in this forum thread in PageLoad. If in your case you are using it in a different way please share all the code connected to RadScheduler that is sued so we could inspect the issue and be more helpful.

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
TPerry
Top achievements
Rank 1
Answers by
Plamen
Telerik team
TPerry
Top achievements
Rank 1
Share this question
or