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

How to set a default Date on Month or Year Navigation of the radCalendar

1 Answer 171 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Vinu
Top achievements
Rank 1
Vinu asked on 30 Jul 2011, 11:44 AM

Hai,

I have a problem with telerik ajax "Calendar".

I managed to set the "DateTime.now" on the page load and it is working perfectly for me.

But the problem is when I click to Navigate using the "prev month, prev year, next month or next year" a "default date is to be selected", instead here the prevoiusly selected date (that is DateTime.now value) exists if any one one of the "Navigation is clicked".

Actually I want a postback on the calendar click and I am plannning to load the data correspending to the "Selected Date". But here the selected date doesnot change on the Navigation Click.

You can see the "system calender" set a default value on the Navigation click to "default 1 st day of the corresponding Month and year".

Is it possible to set a default date on the Navigation month and year click. This is very much needed for this.

And as a workaround "Can we manage to set a default date on the clientside of the navigation cllick"

Any Help is appreciated,

,

Vinu

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 04 Aug 2011, 11:56 AM
Hello Vinu,

You can achieve the default date selection on navigating the calendar using script similar to:
<script type="text/javascript">
    var currentDate;
    function selectDate(sender, eventArgs) {
        if (currentDate) {
            sender.unselectDate(currentDate);
        }
            currentDate = sender.get_focusedDate();
            sender.selectDate(sender.get_focusedDate()); 
    }
</script>

You should call this function on the client CalendarViewChanged event.

Best wishes,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Calendar
Asked by
Vinu
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or