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

Select appointments spanning past VisibleRange

7 Answers 124 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Veteran
Brandon asked on 12 Feb 2018, 10:34 PM

I am using a RadScheduleView (version 2018.1.116) with the MonthViewDefinition.  My users want to be able to select multiple appointments spanning across several months. It appears the RadScheduleView only allows selecting appointments within the current VisibleRange.  For instance, if I select a set of appointments in the current month (such as Feb 8-Feb 10), then navigate to another month and hold Ctrl or Shift while selecting another appointment (such as Jan 5), the previously selected appointments are lost, and only the appointment in the visible month remains selected (i.e. only Jan 5 is selected, Feb 8-Feb 10 are no longer selected).

 

I can select my full appointment range via code-behind (spanning multiple months), but is there a way I can enable this behavior for my users?  I assume this would involve a custom AppointmentSelectionBehavior, but looking at the source code it appears the AppointmentSelectionHelper (an internal class) is what's limiting my selection to the VisibleRange.

7 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Feb 2018, 02:24 PM
Hello Brandon,

Thanks for the detailed description of the behavior you are observing.

I tested the selection of the control and was not able to replicate such malfunction. Attached to my reply you can find the Setting SelectedAppointments SDK Example which I used for testing. Can you please take a look at it? Am I missing something?

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Brandon
Top achievements
Rank 1
Veteran
answered on 15 Feb 2018, 03:39 PM

Stefan,

The problem occurs when I have appointments in different months, and I want to select appointments in both months.  The example you provided only shows appointments within the same month.

 

I was able to reproduce the problem by modifying the ViewModel.GetAppointments() method in your example to add 2 more  appointments:

appointmentList.Add(new Appointment { Subject = "App 7", Start = DateTime.Now.AddDays(40), End = DateTime.Now.AddDays(40).AddHours(1) });
appointmentList.Add(new Appointment { Subject = "App 8", Start = DateTime.Now.AddDays(42), End = DateTime.Now.AddDays(42).AddHours(1) });

 

This makes sure I have 2 appointments that appear in the next month.  To reproduce the problem:

1. Switch to the Month view.

2. Using Ctrl+Click or Shift+Click, select App 4, App 5, and App 6 (all in the current month).

3. Navigate to the next month.

4. Using Ctrl+Click or Shift+Click, select App 7.  This should add App 7 to the list of selected appointments.

5. Navigate back to the current month.  Notice that App 4, App 5, and App 6 are no longer selected (they should have remained selected since App 7 was selected using Shift+Click.

Please let me know if you need any additional information.

 

Thanks,

Brandon

0
Stefan
Telerik team
answered on 20 Feb 2018, 02:59 PM
Hello Brandon,

Thank you for this clarification.

Indeed, when the selected appointments are lost with such an approach. Please, excuse me for the misunderstanding for the previous post.

The behavior you are experiencing is the by-design one. It can be reproduced with each ViewDefinition. The reason behind this implementation is that Outlook does not persist its selection as well. Our RadScheduleView component is inspired by it, thus the same selection behavior is reproduced with it. Even with a custom AppointmentSelectionBehavior such customization could hardly be satisfied with a clean solution.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Brandon
Top achievements
Rank 1
Veteran
answered on 20 Feb 2018, 03:41 PM

Stefan,

The desired behavior I described is a requirement from my client.  Is there any way I can implement this using the RadScheduleView?

I downloaded the source code when I was troubleshooting this, and it looks like the issue is in AppointmentSelectionHelper.PrepareState():

CurrentSelectedAppointments = new List<IOccurrence>(this.SelectedAppointments.Where(this.IsInVisibleRange)),

 

Is there a way I can override this class or method so that

CurrentSelectedAppointments = new List<IOccurrence>(this.SelectedAppointments),

 

Thanks,

Brandon

0
Stefan
Telerik team
answered on 23 Feb 2018, 01:46 PM
Hi Brandon,

The logic to which you refer is internal, as you may have noticed, and cannot be exposed for external modifications. As RadScheduleView exposes its SelectedAppointments collection I am currently researching whether it can be used in conjunction with a custom AppointmentSelectionBehavior so that this requirement can be met. I will update you with my findings shortly.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Stefan
Telerik team
answered on 08 Mar 2018, 04:58 PM
Hello Brandon,

Firstly, I would like to thank you for your patience.

I researched whether such selection behavior can be achieved, but it seems that the control is not designed to be able to select appointments that are not in the current view. Despite that all selected appointments are returned by the custom AppointmentSelectionBehavior the selection does not reflect in the UI. So, I have logged this as a feature request in our system. You can track the state of the relevant item in the Feedback Portal: Support keeping the multiple selection of appointments that are not visible.

Let me know in case I can be of further assistance.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Brandon
Top achievements
Rank 1
Veteran
answered on 08 Mar 2018, 08:32 PM

For now, I guess I will need to keep track of the selections myself and manually synchronize the SelectedAppointments collection based on the existing selections, the current VisibileRange, and the modifier keys pressed.

 

Thanks for the update, I look forward to when this feature is available.

Tags
ScheduleView
Asked by
Brandon
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Brandon
Top achievements
Rank 1
Veteran
Share this question
or