Show24hours toggle button in radScheduler doesnot toggle to show businesshours

6 posts, 1 answers
  1. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 08 Jul 2014 Link to this post

    Hi,
    DayView in my webservicebound scheduler does not  toggle between 24 hours and businesshours. I am sending ajaax request to server to handle  navigation command. It renders timeslots properly for 24 hours and business hours but doesnot toggle the buttons and always displays "show 24 hours" button.

    Here is my server side code, can you tell me if I need any extra configuration?

     ////PK MWF-897  03/31/2014   configure to display 24 hour timeslot  in day and week view
                        if (calendarCommandArgs[2] == "9" && rsTicketsSchedule.DayView.DayStartTime != new TimeSpan(0, 0, 0)) //Show  scheduler for 24 hours 
                        {
                            rsTicketsSchedule.DayView.DayStartTime = new TimeSpan(0, 0, 0);
                            rsTicketsSchedule.DayView.DayEndTime = new TimeSpan(23, 60, 0);
                            
                            rsTicketsSchedule.WeekView.DayStartTime = new TimeSpan(0, 0, 0);
                            rsTicketsSchedule.WeekView.DayEndTime = new TimeSpan(23, 60, 0);
                            
                            rsTicketsSchedule.WorkDayStartTime = new TimeSpan(8, 00, 00);
                            rsTicketsSchedule.WorkDayEndTime = new TimeSpan(18, 30, 00);
                        }
                        else
                        {
                            rsTicketsSchedule.WeekView.DayStartTime = new TimeSpan(8, 0, 0);
                            rsTicketsSchedule.WeekView.DayEndTime = new TimeSpan(18, 30, 00);

                            rsTicketsSchedule.DayView.DayStartTime = new TimeSpan(8, 0, 0);
                            rsTicketsSchedule.DayView.DayEndTime = new TimeSpan(18, 30, 00);
                           

                            rsTicketsSchedule.WorkDayStartTime = new TimeSpan(8, 00, 00);
                            rsTicketsSchedule.WorkDayEndTime = new TimeSpan(18, 30, 00);
                        }


    Thanks,
    Prava
  2. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 11 Jul 2014 Link to this post

    Hello,

    The scenario described is not quite clear. I have tested the toggle between 24 hours and business hours mode and it worked correctly both at my side and on our on-line demos.

    Would you please elaborate the scenario a little bit so we could be more helpful?

    Regards,
    Plamen
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 11 Jul 2014 in reply to Plamen Link to this post

    I have a webservice bound scheduler but I am handelling some of the
    scheduler events (navigation control click) with serevrside code by
    firing ajax request using dummy button.



    Here is how my scheduler is defined in aspx page.  In DayView timeslots
    are rendered properly on click of "show 24 hours"/"Show business hours"
    but button doesnit chahe the text. It always displays "show 24 hour's"
    event though it's already displaying 24 hours.



      <telerik:RadScheduler runat="server"  ID="rsTicketsSchedule"

                                        OnResourcesPopulating="rsTicketsSchedule_ResourcesPopulating"

                                        OnTimeSlotCreated="rsTicketsSchedule_TimeSlotCreated"

                                        OnClientAppointmentsPopulated="OnClientAppointmentsPopulated"

                                        OnClientAppointmentsPopulating="OnClientAppointmentsPopulating"

                                        OnClientResourcesPopulating="OnClientResourcesPopulating"

                                        OnClientAppointmentClick="rsClientAppointmentSingleClick"

                                        OnClientAppointmentCreated="OnAppointmentCreated"

                                        OnClientAppointmentDoubleClick="rsClientAppointmentDoubleClick"

                                        OnClientFormCreated="ClientFormCreated"

                                        OnClientAppointmentMoveEnd="AppointmentMoved"

                                        OnClientAppointmentResizeStart="OnAppointmentResizeStart"

                                        OnClientAppointmentResizeEnd="OnAppointmentResizeEnd"

                                        OnClientAppointmentWebServiceDeleting="OnAppointmentDeleting"

                                        OnClientAppointmentWebServiceUpdating="OnAppointmentUpdating"

                                        OnClientRequestSuccess="OnClientRequestSuccess"

                                        OnClientRequestFailed="OnClientRequestFailed"

                                        OnClientAppointmentMoveStart="StopTimer"

                                        OnClientAppointmentDataBound="OnClientAppointmentDataBound"

                                        OnClientDataBound="onSchedulerDataBound"

                                        AllowInsert ="False"

                                        DisplayDeleteConfirmation="True"

                                        Localization-HeaderToday="Today"

                                        EnableCustomAttributeEditing="True"

                                        EnableDescriptionField="True"

                                        Height="100%"

                                        EnableExactTimeRendering="true"

                                        EnableViewState="true"

                                        OverflowBehavior="Scroll"

                                        ShowAllDayRow ="false"   

                                        SelectedView="TimelineView"

                                        AppointmentStyleMode="Default"

                                        OnClientAppointmentContextMenu ="OnClientAppointmentContextMenu"

                                        OnClientAppointmentContextMenuItemClicked="handle_AppointmentContextMeniItemClick"

                                        OnClientNavigationComplete = "OnClientNavigationComplete"

                                        OnClientNavigationCommand="OnClientNavigationCommand"

                                        OnClientAppointmentEditing="OnClientAppointmentEditing"

                                        OnClientRecurrenceActionDialogShowing="OnClientRecurrenceActionDialogShowing"

                                        OnResourceHeaderCreated="rsTicketsSchedule_ResourceHeaderCreated"

                                    >

                                   <AdvancedForm  Modal="True"  />

                                    <DayView UserSelectable="True" GroupBy="TechName" GroupingDirection="Horizontal"   />

                                    <WeekView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical"  />

                                    <MonthView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical"  />



                                    <TimelineView  

                                        GroupBy="TechName"

                                        ColumnHeaderDateFormat="h:mm tt"

                                        GroupingDirection="Vertical"

                                        HeaderDateFormat="MM/dd/yyyy h:mm tt"

                                        NumberOfSlots ="21"  

                                        SlotDuration="00:30:00"

                                        StartTime="08:00:00"  />



                                          <WebServiceSettings  
    Path="WorkforceServices/M4SchedulerWebService.asmx"
    ResourcePopulationMode="ServerSide" />



                                    <AppointmentContextMenus >

                                        <telerik:RadSchedulerContextMenu
    ID="RsTicketsScheduleContextMenu" runat="server"   >
    </telerik:RadSchedulerContextMenu>

                                    </AppointmentContextMenus>



                                    <ResourceTypes>

                                        <telerik:ResourceType Name="TechName" />

                                        <telerik:ResourceType Name="TicketState" />

                                    </ResourceTypes>



                                    <%-- MWF-752 EG 05/06/2014 --%>

                                    <ResourceHeaderTemplate>

                                        <div>

                                           <asp:Label ID="ResourceLabel" runat="server" Text="Label"/>

                                        </div>

                                    </ResourceHeaderTemplate>



                          </telerik:RadScheduler>





    This is how I am setting timeslots for each view

       public class ScheduleViewModifier

        {

            public DayOfWeek GetSchedulerEndDate(int daysToAdd)

            {

                DayOfWeek schedulerEndDay = DateTime.Now.AddDays(daysToAdd).DayOfWeek;

                return schedulerEndDay;

            }



            public void SetSchedulerToDayView(RadScheduler rsTicketsSchedule)

            {

                rsTicketsSchedule.ShowAllDayRow = false;

                rsTicketsSchedule.EnableExactTimeRendering = true;

                //PK MWF-672 08/20/2013

                ////kk MWF-527  start

                //rsTicketsSchedule.ColumnWidth = 80;

                ////kk MWF-527  end

                rsTicketsSchedule.RowHeight = 30;

                rsTicketsSchedule.MinutesPerRow = 30;

                rsTicketsSchedule.TimeLabelRowSpan = 2;

                rsTicketsSchedule.TimelineView.TimeLabelSpan = 2;

                rsTicketsSchedule.ShowFooter = true;

                rsTicketsSchedule.WorkDayStartTime = new TimeSpan(9, 00, 00);

                rsTicketsSchedule.WorkDayEndTime = new TimeSpan(17, 30, 00);

               

                

            }



            public void SetSchedulerToTimeLineView(RadScheduler rsTicketSchedule)

            {

                rsTicketSchedule.RowHeight = 30;

                rsTicketSchedule.MinutesPerRow = 30;

                rsTicketSchedule.TimeLabelRowSpan = 1;

                rsTicketSchedule.NumberOfHoveredRows = 2;

                rsTicketSchedule.TimelineView.TimeLabelSpan = 1;

            }



            public void SetSchedulerToWeekView(RadScheduler rsTicketsSchedule)

            {

                if (HttpContext.Current.Request["TicketID"] != null)

                {

                    //PK MWF-672 08/20/2013

                    ////kk MWF-527  start

                    //rsTicketsSchedule.ColumnWidth = 352;

                    ////kk MWF-527  end

                    rsTicketsSchedule.RowHeight = 40;

                    rsTicketsSchedule.MinutesPerRow = 30;

                    rsTicketsSchedule.TimeLabelRowSpan = 1;



                    rsTicketsSchedule.EnableExactTimeRendering = false;



                    rsTicketsSchedule.FirstDayOfWeek = DayOfWeek.Monday;

                    rsTicketsSchedule.LastDayOfWeek = DayOfWeek.Friday;

                    rsTicketsSchedule.NumberOfHoveredRows = 1;

                    

                }

                else

                {

                    //PK MWF-672 08/20/2013

                    ////kk MWF-527  start

                    //rsTicketsSchedule.ColumnWidth = 352;

                    ////kk MWF-527  end

                    rsTicketsSchedule.RowHeight = 40;

                    rsTicketsSchedule.MinutesPerRow = 1440;

                    rsTicketsSchedule.TimeLabelRowSpan = 1;

                  //  rsTicketsSchedule.WorkDayStartTime = new TimeSpan(08, 00, 00);

                  //  rsTicketsSchedule.WorkDayEndTime = new TimeSpan(17, 00, 00);

                    rsTicketsSchedule.ShowFooter = false;

                    rsTicketsSchedule.ShowAllDayRow = false;

                    rsTicketsSchedule.EnableExactTimeRendering = false;

                    rsTicketsSchedule.WeekView.ShowHoursColumn = false;



                    rsTicketsSchedule.FirstDayOfWeek = DayOfWeek.Monday;

                    rsTicketsSchedule.LastDayOfWeek = DayOfWeek.Friday;



                    rsTicketsSchedule.NumberOfHoveredRows = 1;

                    rsTicketsSchedule.ShowFullTime = false;

                    

                    

                }



            }



            public void SetSchedulerToMonthView(RadScheduler rsTicketSchedule)

            {

                rsTicketSchedule.ShowAllDayRow = false;

                rsTicketSchedule.EnableExactTimeRendering = false;

                //PK MWF-672 08/20/2013

                    ////kk MWF-527  start

                //rsTicketSchedule.ColumnWidth = 251;

                ////kk MWF-527  end

                rsTicketSchedule.RowHeight = 25;

                rsTicketSchedule.MinutesPerRow = 1440;

                rsTicketSchedule.TimeLabelRowSpan = 1;

                rsTicketSchedule.NumberOfHoveredRows = 1;

                rsTicketSchedule.FirstDayOfWeek =  DayOfWeek.Sunday;   //DateTime.Now.DayOfWeek;

                rsTicketSchedule.LastDayOfWeek = DayOfWeek.Saturday;  //GetSchedulerEndDate(6);

                

            }





            public void ModifySchedulerView(SchedulerNavigationCommand schedulerNavigationCommand, RadScheduler rsTicketsSchedule)

            {

                switch (schedulerNavigationCommand)

                {

                    case (SchedulerNavigationCommand.SwitchToTimelineView):

                        SetSchedulerToTimeLineView(rsTicketsSchedule);

                        break;

                    case (SchedulerNavigationCommand.SwitchToDayView):

                        SetSchedulerToDayView(rsTicketsSchedule);

                        break;

                    case (SchedulerNavigationCommand.SwitchToWeekView):

                       SetSchedulerToWeekView(rsTicketsSchedule);

                        break;

                    case (SchedulerNavigationCommand.SwitchToMonthView):

                       SetSchedulerToMonthView(rsTicketsSchedule);

                        break;

                        //AS:7/10/2012 MWF 253

                    case (SchedulerNavigationCommand.SwitchToSelectedDay):



                        switch (rsTicketsSchedule.SelectedView.ToString())

                        {

                            case "WeekView":

                                SetSchedulerToWeekView(rsTicketsSchedule);

                                break;

                            case "DayView":

                                SetSchedulerToDayView(rsTicketsSchedule);

                                break;

                            case "MonthView":

                                SetSchedulerToMonthView(rsTicketsSchedule);

                                break;

                            case "TimelineView":

                                SetSchedulerToTimeLineView(rsTicketsSchedule);

                                break;

                        }

                        break;

                    // MN 3/28/12 DEV-3999 SwitchToSelectedDay is changed to
    execute by default. No customized event handling is required

                    // to switch the view to Today or to any day from Calendar



                    //case(SchedulerNavigationCommand.SwitchToSelectedDay):

                    //    SetSchedulerToDayView(rsTicketsSchedule);

                    //    break;





                }



            }









        }



    I hope this helps in understanding my issue.

    Thanks,

    Prava

  5. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 11 Jul 2014 in reply to Prava kafle Link to this post

    In addition to above code, on click of  navigation controls especially "show24hour's/show business hours" I am executing following code by sending ajax request
     //Updates scheduler and popup calendar to display correct date
        protected void ScheduleUpdateNavigationBtn_click(object sender, EventArgs e)
        {
            try
            {
              
         ...........

                        ////PK MWF-897  03/31/2014   configure to display 24 hour timeslot  in day and week view
                        if (calendarCommandArgs[2] == "9" && rsTicketsSchedule.DayView.DayStartTime != new TimeSpan(0, 0, 0)) //Show  scheduler for 24 hours  // if (calendarCommandArgs[2] == "8"  &&  rsTicketsSchedule.WeekView.DayStartTime != new TimeSpan(0, 0, 0)) //Show  scheduler for 24 hours
                        {
                            rsTicketsSchedule.DayView.DayStartTime = new TimeSpan(0, 0, 0);
                            rsTicketsSchedule.DayView.DayEndTime = new TimeSpan(23, 60, 0);
                            
                            rsTicketsSchedule.WeekView.DayStartTime = new TimeSpan(0, 0, 0);
                            rsTicketsSchedule.WeekView.DayEndTime = new TimeSpan(23, 60, 0);
                            
                            rsTicketsSchedule.WorkDayStartTime = new TimeSpan(8, 00, 00);
                            rsTicketsSchedule.WorkDayEndTime = new TimeSpan(18, 30, 00);
                        }
                        else
                        {
                            rsTicketsSchedule.WeekView.DayStartTime = new TimeSpan(8, 0, 0);
                            rsTicketsSchedule.WeekView.DayEndTime = new TimeSpan(18, 30, 00);

                            rsTicketsSchedule.DayView.DayStartTime = new TimeSpan(8, 0, 0);
                            rsTicketsSchedule.DayView.DayEndTime = new TimeSpan(18, 30, 00);
                           

                            rsTicketsSchedule.WorkDayStartTime = new TimeSpan(8, 00, 00);
                            rsTicketsSchedule.WorkDayEndTime = new TimeSpan(18, 30, 00);
                        }

    ................................
    ......................................


    Regards,
    Prava
  6. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 14 Jul 2014 Link to this post

    Hi Prava,

    Instead of setting DayStartTime to (0,0,0), please try using the rsTicketsSchedule.ShowFullTime property. Here's how the modified code should look like:
    if (calendarCommandArgs[2] == "9" && rsTicketsSchedule.ShowFullTime == false)
    {
        rsTicketsSchedule.ShowFullTime = true;
    }
    else
    {
        rsTicketsSchedule.ShowFullTime = false;
    }

    This way the label will show the correct text. Hope this was helpful.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 15 Jul 2014 in reply to Bozhidar Link to this post

    Thanks, it worked.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017