How to disable specific date in SharePoint calendar control in SharePoint - c#

I have a Visual WebPart where I am using SharePoint calendar control. I have a requirement to disable specific date in calendar which user can't select. I have tried many ways but no luck. Can anyone help me please.
<SharePoint:DateTimeControl ID="dtDateTimeControl" runat="server" DateOnly="true" />
I have list of dates in a array which I want to disable in the calendar .
20/08/2020
21/08/2020
22/08/2020
23/08/2020
24/08/2020

SharePoint calendar control does not provide a OOB way to achieve this.
DateTimeControl Properties for your reference:
https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ms415699(v=office.14)
You could try to use JQuery DatePicker plugin to achieve your requirement.
Demo:Jquery UI datepicker. Disable array of Dates
Similar issue:
https://social.msdn.microsoft.com/Forums/office/en-US/1194e097-12c9-42a7-9ece-ff40fd81129a/sharepoint-calender-date-disable?forum=sharepointdevelopmentprevious

Related

C# webform calendar

Have a webform that I'm looking to have a calendar that a user can choose the date from the calendar and it then displays the selected date in a textbox. When I choose a calendar from the toolbox how do i minimize the calendar on the generated webpage so it doesn't display the calendar all the time, like only when a drop down is chosen (it takes up alot of space and looks awful).
tried to dispaly the selected date like this but it doesn't work:
TextBox10.Text = "Date" + Calendar1.SelectedDate;
From the sound of what you are trying to do I would recommend either using the AJAX Control Toolkits Calendar Extender or using jQuery UI Datepicker functionality

Display only chosen dates in datepicker

I have history window with date picker but there’s some days without any record in DataBase, I want to disable this days in the datepicker.
Any ideas please.
Thank you
You can use the DayRender event handler for disabling the dates in the datepicker. Refer this sample site to know.
Have a look at the DatePicker.BlackoutDates Property. Dates in this collection will appear as disabled on the drop-down calendar.

MaskedExtender and CalendarExtender in asp.net

I have one textbox in asp.net application. I have used MaskedEditExtender and CalendarExtender. I use the date format yyyy-mm-dd. When i type the date in textbox the typed date displayed in the textbox. But when i select date from calender the date is not displayed in the textbox. Only the masked format "_--_" is displayed. Can anyone able to help me to solve the problem. Thank you..
Make sure your CalendarExtender has the runat="server", Format="yyyy-mm-dd" and TargetControlID="YourTextBox" properties set.
Have you considered using JQuery? It has a lovely Calendar control (datePicker) which is part of the JQuery.UI library. Much more useful than the ASP.AjaxToolkit stuff!

C# Calendar Grid (Appointment Control)

I wanted to ask whether there's a control like a big grid calendar that we can use to manage all the appointments. Like in our cell phone we have calendar and we can save reminders, birthdays, etc. I'm looking for same thing but for the desktop & its size should be at least 600x400.
When the users clicks an individual date the details should be shown.
Is there any control like that available?
There are Calendar controls that might have a view that looks like what you need. For example
BetterCalendar - which is free, open source and pretty nice. Or you can use any of the commercial controls like the one from Infragistics.
You could use the Devexpress components - they provide a good calendar control and also a range of layout controls you could use for the appointment grid.

Showing calendar Control

I am creating a web application in which i have to select a date. I am using Calendar control. But it occupies too much space and other labels and text boxes are not shown in proper alignment. Is there anything I Can do in which when i click on an image, the calendar control opens, but on the textbox, so that it does not occupy any space.
Regards,
Jigar
One possible solution is to use a purely client side date picker, which displays a "pop-in" calendar when the TextBox is selected. Search the web for "date picker" to find tons of JavaScript implementations, including the jQuery UI Datepicker.

Categories

Resources