We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to differentiate between click on "All day" row and "12PM' row?

I am using SfSchedule control for calendar views. I can’t differentiate between the context menu popping up if I click on "All day" row or "12PM" row. Because from ContextMenuOpening event I get back only currentSelectedDate from ContextMenuOpeningEventArgs paramete. But it will be 12PM for a click from "All day" event row also. So I am not able to make the difference, when is all day row clicked and when is 12PM row clicked!? Let me know whether there is a way for me to differentiate between these two cases. Thanks in advance!


1 Reply

VR Vigneshkumar Ramasamy Syncfusion Team July 27, 2015 10:04 AM UTC

Hi Shashanka,

Thanks for using Syncfusion product.

As of now we don’t have any direct support to differentiate the ContextMenuOpening parameters when clicking in AllDay location .But your requirement can be achieved by using CurrentEventArgs parameter in the ContextMenuOpening event .Please find the below code snippet.

C#

private async void schedule_ContextMenuOpening(object sender, Syncfusion.UI.Xaml.Schedule.ContextMenuOpeningEventArgs e)

        {

            var originalSource = e.CurrentEventArgs.OriginalSource;

            var allDayItemsControl = (originalSource as FrameworkElement).FindParentElementOfType<ScheduleAllDaysAppointmentItemsControl>();

            bool isAllDayClicked = allDayItemsControl != null;

            if (isAllDayClicked)

            {

                MessageDialog msgDialog = new MessageDialog("This is AllDay");

            

               await msgDialog.ShowAsync();

            }

        }

We have created simple sample based on your requirement, Please find the sample in the below link.

Sample Link: AllDay_ContextMenu

Please let us know if you have any concerns

Regards

Vigneshkumar R


Loader.
Live Chat Icon For mobile
Up arrow icon