I want to use ContextMenu on the dates in RadCalendar so i can pick the dates and show ContextMenu using right-click, there is an issue that makes me able to right-click on header and somewhere else(but still in Calendar) and the ContextMenu also showed up. this is the code
<
telerik:RadCalendar
x:Name
=
"calendar"
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
Opened
=
"RadContextMenu_Opened"
>
<
telerik:RadMenuItem
Header
=
"Copy"
/>
<
telerik:RadMenuItem
Header
=
"Paste"
/>
<
telerik:RadMenuItem
Header
=
"Cut"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
telerik:RadCalendar
>
private
void
RadContextMenu_Opened(
object
sender, RoutedEventArgs e)
{
var calendarButton = (sender
as
RadContextMenu).GetClickedElement<CalendarButton>();
if
(calendarButton !=
null
)
{
var calendarButtonContent = calendarButton.Content
as
CalendarButtonContent;
if
(calendarButtonContent !=
null
)
{
var clickedDate = calendarButtonContent.Date;
}
}
}
i also want to do that on RadScheduleView so i can only use the ContextMenu on the empty slots or appointment.