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

Radscheduler shows nextday in timetime view at 11PM

1 Answer 66 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Prava kafle
Top achievements
Rank 1
Prava kafle asked on 21 Feb 2013, 10:08 PM
Hi,
 I have Radscheduler which displays next day's calendar after 11 PM.  I fixed the time range displayed in  timeline view of calendar  by setting start date  on initial page load. However when I click "Today" , it again shows next day in timeline view. 
Is there any event fired on clicking"Today" so that I can set scheduler's selected date,  or  am I missing a setting?

c# Code
  //PK 02/18/2013  Set selected date of scheduler, so it does not show next day's timelineview  at 11:00 PM
               if (!IsPostBack)    
                   rsTicketsSchedule.SelectedDate = DateTime.Now.Date;

ASPX:
  <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Office2007"
                        Width="100%" RowHeaderWidth="52" OverflowBehavior="Auto" ShowFooter="false" DataSourceID="SchedulerDataSource"
                        DataKeyField="AppointmentID" DataStartField="Start" DataEndField="End" DataSubjectField="Subject"
                        CustomAttributeNames="Due, Priority" RowHeight="37px" OnAppointmentCommand="RadScheduler1_AppointmentCommand"
                        OnAppointmentInsert="RadScheduler1_AppointmentInsert" SelectedView="TimelineView" 

                       
                     >
                      <TimelineView GroupBy="Calendar" GroupingDirection="Vertical"  SlotDuration="00:30:00"
                           ColumnHeaderDateFormat="hh:mm"></TimelineView>
                        <AdvancedForm Modal="true"></AdvancedForm>
                        <AppointmentTemplate>
                            <%# Eval("Subject") %>
                                <asp:Button runat="server" ID="UnscheduleAppointment" CssClass="simpleButton" CommandName="Unschedule"
                                Text="&nbsp;" ToolTip="Unschedule this appointment"></asp:Button>
                        </AppointmentTemplate>
                        <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
                        <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
                   
                    </telerik:RadScheduler>

http://demos.telerik.com/aspnet-ajax/scheduler/examples/timelineview/defaultcs.aspx

Thanks,
Prava

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 26 Feb 2013, 04:02 PM
Hello,

I would suggest using the OnNavigationCommand server-side event handler to cancel the default behavior when user clicks on Today's button and implement your custom logic as shown in code snippet:
//markup code
<telerik:RadScheduler runat="server" ID="RadScheduler1" OnNavigationCommand="RadScheduler1_NavigationCommand">         
    </telerik:RadScheduler>
//code behind
protected void RadScheduler1_NavigationCommand(object sender, SchedulerNavigationCommandEventArgs e)
{
    if (e.Command == SchedulerNavigationCommand.NavigateToNextPeriod && RadScheduler1.SelectedView == SchedulerViewType.TimelineView)
    {
        e.Cancel = true;
        RadScheduler1.SelectedDate = here goes the desired date
    }
}

Regards,
Boyan Dimitrov
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
Scheduler
Asked by
Prava kafle
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or