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

Selection Highlight

4 Answers 189 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rebecca
Top achievements
Rank 1
Rebecca asked on 28 Sep 2011, 04:39 PM
There is a Selection Highlight that highlights slots in the ScheduleView control; however it doesn't appear to actually select any appointments within the highlighted slots.

I am looking for information on how to use the selection highlight.

Thank you for your time.

4 Answers, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 30 Sep 2011, 09:36 AM
Hi Rebecca,

It is a completely different selection. RadScheduleView supports a SelectedAppointment as well as SelectedSlot. They are mutually exclusive. While the one is set the other is null. You could use the selected slot in various cases such as inline appointment editing. For example drag to select several slots and then type a few keys on the keyboard - an appointment will be created exactly over the selected slots. The SelectedSlot could further be used for integration with other controls such as RibbonView, Menus etc showing details for the selected time or as a parameter for creating new Appointments.

All the best,
Pana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Rebecca
Top achievements
Rank 1
answered on 30 Sep 2011, 05:04 PM
Thank you very much for clarifying how this works.

I have created a control template for the RadScheduleView based on the ControlTemplate for the RadScheduleView in the Telerik "Office Black" theme.

I have added KeyBindings so that a new appointment is created when the user clicks the Insert key like this:
<KeyBinding Command="telerik:RadScheduleViewCommands.CreateAppointment" Key="Insert" />

This works fine if the user clicks the Insert key on the number pad when numlock is on; but, if the user clicks the normal insert key on the keyboard, or if they click the insert key on the number pad when numlock is off, the appointment is not created.

I added in a method that handles the RadScheduleView PreviewKeyDown event to check the actual value of the key being pressed.
Private Sub myScheduleView_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles myScheduleView.PreviewKeyDown
        MessageBox.Show(e.Key.ToString)
End Sub

When I click the Insert key on the number pad when numlock is on, "NumPad0" appears in the message box as the key that was pressed and (for some reason) a new appointment is created.
When I click the Insert key on the number pad when numlock is off, "Insert" appears in the message box as the key that was pressed and no new appointment.
When I click the regular Insert key on the keyboard, "Insert" appears in the message box as the key that was pressed and no new appointment is created.

So, my question is, why does the appointment get created when I click the insert key on the number pad (which is "NumPad0") but not when I click the regular insert key on the keyboard (which is "Insert") even though I have a KeyBinding that specifies that the appointment should be created when I click the Insert key?

How do I fix this problem?

Thank you again for clarifying how the selection works and for your help!

-Rebecca
0
Pana
Telerik team
answered on 06 Oct 2011, 06:36 AM
Hi Rebecca,

I am sorry Rebecca, the KeyBindings does come from the WPF Framework and there is not much we could do about that problem. I guess you could Execute the CreateAppointment command in code behind on the very same place you have added the event handler.

Kind regards,
Pana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Rebecca
Top achievements
Rank 1
answered on 07 Oct 2011, 03:39 PM
Thank you for your help Pana
Tags
ScheduleView
Asked by
Rebecca
Top achievements
Rank 1
Answers by
Pana
Telerik team
Rebecca
Top achievements
Rank 1
Share this question
or