Dear Telerik,
The ScheduleView implements a Context menu, and I'd like to hide some menu items depending on some info from the active slot and the position of the mouse. So, I added the following to the XAML:
And in the Opening event handler I'm applying some logic to make visible or not some menu items:
The above logic is not enough, as I'd like to know the active slot to be able to decide (not only the Active Appointment as shown above, but also the active slot). Note that the ScheduleView.SelectedSlot and the ScheduleView.MouseOverSlot are most of the time null, and I could not depend on them.
In the attached image you could see that we have different types of slots (each with different attributes and styles), and I need to be able to identify where the user was when the context menu was opening. And if it is a slot, the start and end of the slot, if it's a day header, the date, etc.
Looking forward to your reply, and counting always on your great support.
Salah A. Malaeb
TeknoBuild
The ScheduleView implements a Context menu, and I'd like to hide some menu items depending on some info from the active slot and the position of the mouse. So, I added the following to the XAML:
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
Opening
=
"contextMenuOpening"
>
<
telerik:RadMenuItem
x:Name
=
"menuItemExpenses"
Header
=
"Expenses"
Click
=
"menuItemExpenses_Click"
/>
<
telerik:RadMenuItem
x:Name
=
"menuItemCreateSlot"
Header
=
"Create Slot"
Click
=
"menuItemCreateSlot_Click"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
And in the Opening event handler I'm applying some logic to make visible or not some menu items:
private
void
contextMenuOpening(
object
sender, Telerik.Windows.RadRoutedEventArgs e)
{
AppointmentItem appointmentItem = (sender
as
RadContextMenu).GetClickedElement<AppointmentItem>();
if
(appointmentItem ==
null
)
menuItemCreateSlot.Visibility = System.Windows.Visibility.Visible;
else
menuItemCreateSlot.Visibility = System.Windows.Visibility.Collapsed;
}
The above logic is not enough, as I'd like to know the active slot to be able to decide (not only the Active Appointment as shown above, but also the active slot). Note that the ScheduleView.SelectedSlot and the ScheduleView.MouseOverSlot are most of the time null, and I could not depend on them.
In the attached image you could see that we have different types of slots (each with different attributes and styles), and I need to be able to identify where the user was when the context menu was opening. And if it is a slot, the start and end of the slot, if it's a day header, the date, etc.
Looking forward to your reply, and counting always on your great support.
Salah A. Malaeb
TeknoBuild