A few questions regarding the scheduler and the month view

1 Answer 135 Views
Scheduler and Reminder
Sean
Top achievements
Rank 1
Sean asked on 28 Jun 2022, 05:42 PM | edited on 28 Jun 2022, 10:14 PM

Hello! Telerik for Winform has been really nice so far. I'm trying to see how these things can be accomplished with the Scheduler.

I hope it is okay to ask multiple questions in a single post since it is all related to the same control. If not, I can make a new post for each question.

1. Only show the Dates that are within X month.

Bad Paint edit of what I'd like to achieve

I want to be able to only show the dates that are for the selected month (or programmatically set month)

Ex: User selects July 2022, the scheduler should only show July 1 through July 30 and nothing from June or Aug.

I can hide the dates/cells from showing up, but that leaves empty spaces. It would be nice to fill up those spaces

If e.CellElement.Date.Month <> Date.Now.Month Then
    If Not (TypeOf e.CellElement Is SchedulerHeaderCellElement) Then
        e.CellElement.Visibility = ElementVisibility.Hidden
    End If
End If

2. Change all cell colors to be the same instead of the default where its alternates between light/dark colors

3. Showing full month shrinks the cells, it only fits 1  appointment.

I'm guessing if #1 is possible, there will be more room to change the size of the cells?

I'm hoping some of these questions can be answered, it would greatly help me not waste the trial times

1 Answer, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Jun 2022, 09:45 AM

Hello, Sean,

It is OK to ask multiple questions within the same ticket in case they are all related. Now, I will go straight to your questions:

1. It is possible to indicate whether the month view should always display exactly one month with the respective number of weeks. It is controlled by the ShowFullMonth property that SchedulerMonthView offers. However, it is not expected to hide the days belonging to other months:

Sub New()

    InitializeComponent()

    AddHandler Me.RadScheduler1.CellFormatting, AddressOf SchedulerCellFormatting
    Me.RadScheduler1.FocusedDate = New DateTime(2022, 7, 1)
    Me.RadScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Month
    Dim monthView As SchedulerMonthView = Me.RadScheduler1.GetMonthView()
    monthView.ShowFullMonth = True

End Sub

Private Sub SchedulerCellFormatting(sender As Object, e As SchedulerCellEventArgs)
    If e.CellElement.Date.Month <> Me.RadScheduler1.FocusedDate.Month AndAlso Not TypeOf e.CellElement Is SchedulerHeaderCellElement Then
        e.CellElement.Visibility = Telerik.WinControls.ElementVisibility.Hidden
    Else
        e.CellElement.ResetValue(VisualElement.VisibilityProperty, ValueResetFlags.Local)
    End If

End Sub

Before:

After:

2. If you need to customize the style for scheduler cells, it is appropriate to use the CellFormatting event. Please refer to the following help article demonstrating how to use this approach:

https://docs.telerik.com/devtools/winforms/controls/scheduler/appearance/formatting-cells 

3. Note that RadScheduler's size determine the size that will be used for displaying the month view. Hence, the more weeks are shown in the month view, the less height will be available for each week per row.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Tags
Scheduler and Reminder
Asked by
Sean
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or