Articles in this section

How to get tapped date details while tapping view header in WPF Scheduler (Calendar)

You can get the tapped date details when tapping the view header of SfScheduler using ViewHeaderCellTapped in WPF.

XAML

Interaction behavior added to SfScheduler to handle the ViewHeaderCellTapped handler.

<syncfusion:SfScheduler 
    x:Name="Schedule" 
    ViewType="Week" >
    <interactivity:Interaction.Behaviors>
        <local:SchedulerBehavior/>
    </interactivity:Interaction.Behaviors>
</syncfusion:SfScheduler>

C#

In ViewHeaderCellTapped, you can get the tapped date details by the property of DateTime of ViewHeaderCellTappedEventArgs.

namespace WpfScheduler
{
    public class SchedulerBehavior : Behavior<SfScheduler>
    {
 
        SfScheduler scheduler;
 
        protected override void OnAttached()
        {
            base.OnAttached();
            scheduler = this.AssociatedObject;
            this.AssociatedObject.ViewHeaderCellTapped += Scheduler_ViewHeaderCellTapped;
        }
 
        private void Scheduler_ViewHeaderCellTapped(object sender, ViewHeaderCellTappedEventArgs e)
        {
            var dateTime = e.DateTime.ToString();
            MessageBox.Show("Date" + " " + dateTime, "HeaderCellTapped", MessageBoxButton.OK);
        }
 
        protected override void OnDetaching()
        {
            base.OnDetaching();
            this.AssociatedObject.ViewHeaderCellTapped -= Scheduler_ViewHeaderCellTapped;
            this.scheduler = null;        }
    }
}

Output

Demo image to get the tapped details of the date in WPF scheduler

View sample in GitHub

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied