Night hours

9 posts, 1 answers
  1. Mattia
    Mattia avatar
    36 posts
    Member since:
    Jan 2012

    Posted 09 Jan 2013 Link to this post

    Hi, there is a way to hide the hours in the scheduler, from for example 11 pm to 7 am? i want show only the day

    Thanks
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Jan 2013 Link to this post

    Hi Mattia,

    One suggestion is that you can set the WorkDayStartTime and WorkDayEndTime and specify the NumberOfSlots in the TimelineView as follows.

    ASPX:
    <telerik:RadScheduler ID="RadScheduler1" runat="server"  WorkDayStartTime="07:00:00" WorkDayEndTime="23:00:00" ............ >
         <TimelineView SlotDuration="01:00" NumberOfSlots="17" ColumnHeaderDateFormat="hh:mm"/>
    </telerik:RadScheduler>

    Hope this helps.

    Regards,
    Princy.
  3. Mattia
    Mattia avatar
    36 posts
    Member since:
    Jan 2012

    Posted 10 Jan 2013 Link to this post

    I tried but it doesn't work.

    <telerik:RadScheduler ID="RadScheduler1" runat="server"  WorkDayStartTime="8:30:00" WorkDayEndTime="19:30">
    ...
    ....
     <TimelineView GroupBy="Room" NumberOfSlots="24" ColumnHeaderDateFormat="t" GroupingDirection="Vertical"
                        StartTime="08:00:00" ShowInsertArea="false" TimeLabelSpan="1"  SlotDuration="00:30:00" />

    it shows all hours. I want to show hours from 8.30 am to 7.30 pm (i'm using italian format)
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Jan 2013 Link to this post

    Hi,

    Try setting the SelectedDate as follows to achieve your scenario.

    ASPX:
    <telerik:RadScheduler ID="RadScheduler1" runat="server"  SelectedDate="2013-01-14 08:30:00" WorkDayStartTime="08:30:00" WorkDayEndTime="19:30:00" ............. >
       <TimelineView ColumnHeaderDateFormat="t" GroupingDirection="Vertical" NumberOfSlots="23"  ShowInsertArea="false" TimeLabelSpan="1"  SlotDuration="00:30:00"  />
    </telerik:RadScheduler>

    Hope this helps.

    Regards,
    Princy.
  5. Mattia
    Mattia avatar
    36 posts
    Member since:
    Jan 2012

    Posted 15 Jan 2013 Link to this post

    it's doesn't works
    here my code:


          <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Windows7" SelectedView="TimelineView"
                    Culture="it-IT" DayStartTime="08:00:00" OnFormCreating="RadScheduler1_FormCreating"
                    Reminders-Enabled="false" FirstDayOfWeek="Monday" Height="100%" DataSourceID="SqlDataSource1"
                    WorkDayStartTime="08:00" CssClass="rsCategoryRed" RowHeaderWidth="70px" DataEndField="Fine"
                    DataKeyField="ID" DataStartField="Start" DataSubjectField="Subject" DataDescriptionField="Description"
                    OnTimeSlotCreated="RadScheduler1_TimeSlotCreated" DataReminderField="RecurrenceRule"
                    EnableDescriptionField="True" OnAppointmentClick="RadScheduler1_OnAppointmentClick"
                    OnClientAppointmentClick="OnClientAppointmentClick" OnClientTimeSlotClick="OnClientTimeSlotClick"
                    WorkDayEndTime="19:30" RowHeight="90px" EnableExactTimeRendering="True" DayView-WorkDayEndTime="19:30"
                    DayView-WorkDayStartTime="08:00" AdvancedForm-EnableCustomAttributeEditing="true"
                    CustomAttributeNames="Terapista" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
                    OnAppointmentContextMenuItemClicked="RadScheduler1_OnAppointmentContextMenuItemClicked"
                    OnNavigationCommand="RadScheduler1_NavigationCommand" SelectedDate="2013-01-16 08:30:00"
                    Localization-AdvancedEditAppointment="Modifica appuntamento" Localization-ConfirmDeleteText="Sicuro di eliminare l'appuntamento?"
                    Localization-ConfirmDeleteTitle="Eliminazione" Localization-HeaderToday="Oggi"
                    OnAppointmentUpdate="RadScheduler1_OnAppointmentUpdate" Localization-AdvancedCalendarCancel="Annulla"
                    Localization-AdvancedCalendarToday="Oggi" Localization-AdvancedClose="Chiudi"
                    Localization-AdvancedDescription="Descrizione" Localization-AdvancedDone="Fatto"
                    Localization-AdvancedNewAppointment="Nuovo appuntamento" Localization-ContextMenuDelete="Elimina"
                    Localization-ContextMenuEdit="Modifica" Localization-ContextMenuGoToToday="Vai a oggi"
                    Localization-Save="Salva" Localization-ConfirmCancel="Annulla" Localization-ContextMenuAddAppointment="Nuovo appuntamento"
                    DayEndTime="19:30" OnResourceHeaderCreated="RadScheduler1_ResourceHeaderCreated"
                    ShowAllDayRow="False" Localization-HeaderDay="Gionaliero" Localization-HeaderMonth="Mese"
                    BorderColor="#FFE6BF" AdvancedForm-Enabled="False" StartEditingInAdvancedForm="false">
                    <AdvancedForm Modal="true" />
                    <Localization AdvancedCalendarCancel="Annulla" AdvancedCalendarToday="Oggi" AdvancedClose="Chiudi"
                        AdvancedDescription="Descrizione" AdvancedDone="Fatto" AdvancedEditAppointment="Modifica appuntamento"
                        AdvancedNewAppointment="Nuovo appuntamento" ConfirmCancel="Annulla" ConfirmDeleteText="Sicuro di eliminare l'appuntamento?"
                        ConfirmDeleteTitle="Eliminazione" ContextMenuAddAppointment="Nuovo appuntamento"
                        ContextMenuDelete="Elimina" ContextMenuEdit="Modifica" ContextMenuGoToToday="Vai a oggi"
                        HeaderToday="Oggi" Save="Salva" HeaderDay="Giornaliero" HeaderWeek="Settimana" />
                    <ExportSettings OpenInNewWindow="true" FileName="SchedulerExport">
                        <Pdf PageTitle="Schedule" Author="" Creator="" Title="Schedule" />
                    </ExportSettings>
                    <TimelineView GroupBy="Room" NumberOfSlots="24" ColumnHeaderDateFormat="t" GroupingDirection="Vertical"
                        StartTime="08:00" ShowInsertArea="false" TimeLabelSpan="1" SlotDuration="00:30:00" />
                    <ResourceTypes>
                        <telerik:ResourceType KeyField="ID" Name="Room" TextField="RoomName" ForeignKeyField="RoomID"
                            DataSourceID="RoomsDataSource" />
                    </ResourceTypes>
                   
                    <TimeSlotContextMenuSettings EnableDefault="true" />
                    <AppointmentContextMenuSettings EnableDefault="true" />
                    <AppointmentContextMenus>
                        <telerik:RadSchedulerContextMenu ID="RadSchedulerContextMenu1" runat="server">
                            ... </telerik:RadSchedulerContextMenu>
                    </AppointmentContextMenus>
                    <AppointmentTemplate>....</AppointmentTemplate>
                </telerik:RadScheduler>

    i want to show hours from 8.00 am to 7.30 pm
  6. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 18 Jan 2013 Link to this post

    Hello,

    Please set the RadScheduler SelectedDate property to а date property and this will avoid that issue:
    //markup code
    <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedDate="2013-01-16" ...........>
     ..........    
             <TimelineView GroupBy="Room" NumberOfSlots="24" ColumnHeaderDateFormat="t"  GroupingDirection="Vertical"
                        StartTime="08:00" ShowInsertArea="false"  SlotDuration="00:30:00" />    
        </telerik:RadScheduler>

    Please find attached a sample image demonstrating the application behavior at my side.

    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.
  7. Mattia
    Mattia avatar
    36 posts
    Member since:
    Jan 2012

    Posted 18 Jan 2013 Link to this post

    ok i have the same view..but when you press the right arrow to move in the day it will show the hours from 20.00 to 7.30 am 
    and I don't want it..it's possible to move till the next day at 08.00 am?
  8. Answer
    Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 23 Jan 2013 Link to this post

    Hello,

    An easy and convenient way of achieving that functionality would be to provide a custom handler for clicking on the right arrow if you are currently in RadScheduler TimelineView. You can cancel the default behavior and add custom logic that will fit your requirement as shown in the code snippet below:
    //markup code

    <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Windows7" .....
    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 = RadScheduler1.SelectedDate.AddDays(1);
            RadScheduler1.TimelineView.StartTime = new TimeSpan(8, 0, 0);
        }
    }

    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.
  9. Mattia
    Mattia avatar
    36 posts
    Member since:
    Jan 2012

    Posted 23 Jan 2013 Link to this post

    thanks..it's works!

Back to Top