This is a migrated thread and some comments may be shown as answers.

Bind and Enable dates to Datepicker

3 Answers 81 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jeff Wickersham
Top achievements
Rank 1
Jeff Wickersham asked on 05 Aug 2012, 03:01 PM
I need some guidance on how to accomplish the following.
1. Need to bind datepicker to datatable or list
2. Then only highlight and enable the dates in that datatable or list, all other dates to be disabled

Thanks

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 09 Aug 2012, 07:26 AM
Hi Jeff,

You can use the DayRender server and client events of the calendar to disable dates, as shown in this code library:
http://www.telerik.com/community/code-library/aspnet-ajax/calendar/disabling-calendar-days.aspx

As for getting them from database, you can build server and client collections of the dates from DB and use them when executing the logic to disable certain days in the calendar.

Regards,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Gerd
Top achievements
Rank 1
answered on 30 Aug 2012, 09:10 AM
Hello,

Is there also a possibility to disable all the dates first ?  E.g. DatePicker.Dates.DisablaAll
So we can set only date A and B to be enabled with the SpecialDays

thanks
gerd
0
Tsvetina
Telerik team
answered on 03 Sep 2012, 04:21 PM
Hi Gerd,

There is not such option for RadCalendar, as the month views are built on the fly, they are not initially available. One option would be to set AutoPostBack="true" for the calendar, and on the server DayRender event disable/enable dates based on DB values. To prevent the page from reloading on navigation, you could wrap the RadCalendar in a RadAjaxPanel or add it to a RadAjaxManager setting where it updates itself.

Regards,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Calendar
Asked by
Jeff Wickersham
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Gerd
Top achievements
Rank 1
Share this question
or