How to restrict Multiple dates selection in MonthCalender - winforms

I am use MonthCaalender to select a date
How to restrict Multiple dates selection in the same

Set the MaxSelectionCount property of the month calendar.

You can apply simple logic on MonthCaalender to remove selected date on mouse down event.
Just use Mousedown and Clear all selection from moth calender.
Cheers!

Related

How to provide custom list of selectable dates to the calendar in react-native

I want to supply the list of dates to the calendar such that the selected dates are shown and the other dates are greyed out or not selectable in the calendar.
Sending a list of dates to the calendar in such a way that when user opens the calendar to select a date, only the dates from the list is visible and the other dates are greyed out.
use https://github.com/wix/react-native-calendars#date-marking, and after give a obj to markedDates and set disabled to true

Is Range selection possible in WPF Date Picker?

My requirement is to have some relative date support in my date picker and I want to select start and end date from wpf date picker. But picker showing single calendar and i couldn't achieve two date selection.i have gone through some sites but couldn't get clear answer.
Is it possible to achieve my requirement in WPF date picker or any custom template available for this?
Thanks,
Indrajeyan.

WPF Datepicker scroll through dates in textbox

I would like to scroll using the arrow keys through the day month and year fields in the datepicker textbox.
I am guessing this will be a two step solution:
1- break up month day year into individual fields that the user 'clicks' into.
2- once the user has focus of the either day year or month then they can use arrow keys to scroll up /down.
anyone done this before with wpf?
Found this project has a date time with up / down:
http://wpftoolkit.codeplex.com/

WPF Calendar: Boldface specified dates?

I am creating a window that uses a WPF calendar to browse documents created on specified dates during the month shown. When the calendar changes month, I search a database for all documents created during that month, which I use to create a list of dates during the month that have documents.
In the Calendar control, I want to boldface those dates that have documents, in the same manner that Outlook boldfaces dates that have appointments.
So, here's my question: How do I boldface a specific date in the Calendar control's month view? Thanks for your help.
This may help.
http://www.c-sharpcorner.com/UploadFile/mahesh/539/Default.aspx
The "Selected Date and Selected Dates" area will show you how to select them, and further down it can show you how to format your calendar. That is, if you're using the same calendar which I hope you are. Hope this helps.
Selected Date and Selected Dates
SelectedDate property represents the current selected date. If multiple date selection is true, then SelectedDates property represents all selected dates in a Calendar. The following code snippet sets the SelectedDates in XAML at design-time.
<Calendar Name="MonthlyCalendar"
SelectionMode="MultipleRange"
DisplayDate="3/5/2010"
DisplayDateStart="3/1/2010"
DisplayDateEnd="3/31/2010"
FirstDayOfWeek="Tuesday"
IsTodayHighlighted="True"
xmlns:sys="clr-namespace:System;assembly=mscorlib" Margin="15,39,88,19">
<Calendar.SelectedDates>
<sys:DateTime>3/5/2010</sys:DateTime>
<sys:DateTime>3/15/2010</sys:DateTime>
<sys:DateTime>3/25/2010</sys:DateTime>
</Calendar.SelectedDates>
</Calendar>
The selected dates in a Calendar looks like Figure 8 where you can see March 5th, 15th, and 25th have a light blue background and represents the selected dates.
The following code snippet sets the SelectedDates property in WPF at run-time.
private void AddSelectedDates()
{
MonthlyCalendar.SelectedDates.Add(new DateTime(2010, 3, 5));
MonthlyCalendar.SelectedDates.Add(new DateTime(2010, 3, 15));
MonthlyCalendar.SelectedDates.Add(new DateTime(2010, 3, 25));
}
It turns out that boldfacing is hard-coded in several places, so I changed to date highlighting instead. I wrote a custom control that has a HighlightedDates list; adding a date to the list highlights the date and provides an optional tool tip for the date with whatever content the host app chooses.
I have written a CodeProject article titled Extending the WPF Calendar. The article includes the control and explains how I built it.

Date Picker Today Option In WPF

Is there any property , option available in the date picker control so that if user want to select today from any date from current date ?
e.g if user is view current month of last year then he has the option to select current date ?
just see this link and how they are implementing the Today button in the Datepicker WPF Toolkit). This link is from the WPFToolkit discussion forum. May be this will help you.
http://wpf.codeplex.com/Thread/View.aspx?ThreadId=85516
i think there is no option that there is a button directly in the control.
You can use a button outside the control, or something like this to set the current date.
Or you build a custom control....
I just hacked together a simple example. It is VS 2010. www.mbgr.de/CurrentDateWpf.zip.
No warranty at all on this one. Use at your own risk :-)

Resources