Click here to Skip to main content
15,851,319 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Good evening, 
I have downloaded a template I need help please I would like to have the code in C# of when I click on a cell it will get the date of the corresponding cell. thank you in advance. the name of the user control is calendar but there is no method to select date. 

What I have tried:

I want the source code or a method
Updated 17-Feb-21 5:40am

1 solution

It's going to depend on which Calendar control yopu ar eusing. There are two main ones:
Calendar Class (System.Windows.Controls) | Microsoft Docs[^]
Calendar Class (System.Web.UI.WebControls) | Microsoft Docs[^]
The first one is used in WPF apps, the second in web sites.

We have no idea what environment your app is running.

The WPFone has a Calendar.SelectedDatesChanged Event (System.Windows.Controls) | Microsoft Docs[^] which tells you when the user did something, the website one doesn't, because that would be silly - given that C# code is always executed on the server, not the client, and a round trip would be very user unfriendly.

If you aren't using either of those, you would need to look at what your control provides, we have no idea what it is or where you got it!

Whatever way, start with the control documentation, and see what it provides and what sample code is available.
Share this answer
Member 15037126 22-Feb-21 4:47am    
Member 15037126 22-Feb-21 4:53am    
here is where I took the template, so I want that by clicking on a cell, it will get me the date of the corresponding one thank you in advance it will really be of great importance to me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900