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

Day box height in month view

2 Answers 11 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Joaquín
Top achievements
Rank 2
Joaquín asked on 05 May 2016, 10:32 AM

Hi guys,

I have a scheduler defined like this:

<telerik:RadScheduler ID="RadScheduler1" runat="server"
            Skin="Windows7"
            AllowDelete="False"
            AllowInsert="False"
            AllowEdit="False"
            SelectedView="MonthView"
            Culture="en-GB"
            LastDayOfWeek="Friday"
            FirstDayOfWeek="Monday"
            ShowFooter="False"
            ShowAllDayRow="false"
                     
            EnableRecurrenceSupport="False"
            AdvancedForm-Enabled="False"
            OverflowBehavior="Expand"
            RowHeight="35px">
 
            <DayView UserSelectable="true" />
 
            <WeekView UserSelectable="true" ShowAllDayInsertArea="False" ShowInsertArea="False" >
            </WeekView>
 
            <MonthView UserSelectable="true" MinimumRowHeight="3" />
 
            <MultiDayView UserSelectable="false" />
            <TimelineView UserSelectable="false" />
            <YearView UserSelectable="false" />
                     
        </telerik:RadScheduler>

I bind the appointents, and with the TimeSlotCreated hook I create special days for the holidays:

Protected Sub RadScheduler1_TimeSlotCreated(sender As Object, e As TimeSlotCreatedEventArgs) Handles RadScheduler1.TimeSlotCreated
 
        Dim añoInicial As Integer = Today.Year
        Dim añoFinal As Integer = Today.Year + 2
 
        Dim dicNonLaborDays As Dictionary(Of Date, String) = clsDataBaseFunctions.GetNonLaborDays(añoInicial, añoFinal)
 
        For Each fiesta In dicNonLaborDays
 
            If DateTime.Compare(e.TimeSlot.Start.[Date], fiesta.Key) = 0 Then
                'Set the CssClass property to visually distinguish your special days.
                e.TimeSlot.CssClass = "Disabled"
 
                Dim lblNombreFiesta As New Label
                lblNombreFiesta.Text = fiesta.Value
 
 
                If Not IsNothing(e.TimeSlot.Control) Then       'Si es Nothing es porque hay un appointment en esa fecha
 
                    Select Case RadScheduler1.SelectedView
                        Case SchedulerViewType.DayView
                            e.TimeSlot.Control.Controls.AddAt(1, lblNombreFiesta)
                        Case SchedulerViewType.WeekView
                            e.TimeSlot.Control.Controls.AddAt(1, lblNombreFiesta)
                        Case SchedulerViewType.MonthView
                            e.TimeSlot.Control.Controls.AddAt(1, lblNombreFiesta)
                    End Select
                End If
            End If
        Next
 
        ' Resaltar la fecha de hoy
        If DateTime.Compare(e.TimeSlot.Start.[Date], DateTime.Now.[Date]) = 0 Then
 
            Select Case RadScheduler1.SelectedView
                Case SchedulerViewType.DayView
                    e.TimeSlot.CssClass = "CurrentDay_WeekView"
                Case SchedulerViewType.WeekView
                    e.TimeSlot.CssClass = "CurrentDay_WeekView"
                Case SchedulerViewType.MonthView
                    e.TimeSlot.CssClass = "CurrentDay_MonthView"
            End Select
 
        End If
 
    End Sub

Everything Works fine. In month view, when there are no holidays in the displayed month, the height of the days boxes is 3 lines (3 divs), as defined with:

<MonthView UserSelectable="true" MinimumRowHeight="3" />

However, if there is any holiday present in the displayed month, the height of all the displayed days boxes changes to 4.

I would like to keep the height of all the days boxes (regardless there are holidays or not present) in 3 lines. Is there any way to achieve this?

Thank you,

Joaquín

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Zhekov
Telerik team
answered on 06 May 2016, 11:04 AM
Hi, Joaquin.

Just add VisibleAppointmentsPerDay:

<MonthView AdaptiveRowHeight="false" UserSlectable="True" MinimumRowHeight="3" VisibleAppointmentsPerDay="3" />



Regards,
Ivan Zhekov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Joaquín
Top achievements
Rank 2
answered on 08 May 2016, 02:09 PM

Thank you Ivan!

All perfect now.

 

Joaquín

Tags
Scheduler
Asked by
Joaquín
Top achievements
Rank 2
Answers by
Ivan Zhekov
Telerik team
Joaquín
Top achievements
Rank 2
Share this question
or