Articles in this section

How to get tapped date details in WinUI Scheduler (Calendar)?

Get the tapped date details when tapping the view header of the WinUI Scheduler using the ViewHeaderCellTapped in WinUI.

XAML

Handler for ViewHeaderCellTapped is defined with the Scheduler.

<Grid>
    <scheduler:SfScheduler x:Name="Schedule" ViewType="Week" ViewHeaderCellTapped="OnViewHeaderCellTapped"/>
</Grid>

C#

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

//Event Customization
private async void OnViewHeaderCellTapped(object sender, ViewHeaderCellTappedEventArgs e)
{
    var dateTime = e.DateTime.ToString();
    ContentDialog contentDialog = new ContentDialog()
    {
        Title = "HeaderCellTapped",
        Content = "Date" + " " + dateTime,
        CloseButtonText = "Ok"
    };
 
    //Set XamlRoot for WinUI desktop applications
    contentDialog.XamlRoot = this.Schedule.XamlRoot;
    await contentDialog.ShowAsync();
}

Graphical user interface, application, table, Excel

Description automatically generated


Conclusion

I hope you enjoyed learning about how to get tapped date details while tapping the view header in WinUI Scheduler (Calendar).

You can refer to our WinUI Scheduler feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our 
WinUI Scheduler example
 to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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