Skip to main content Skip to footer

Change the Background Color of Specific Dates in CalendarView

Background:

There is no direct way to set the style for specific dates in C1CalendarView, but as a workaround you can add the specific dates in the BoldedDates object, which is an array of type DateTime. Then, set the style for the bolded dates as given in code snippet below:

Dim dt As Date() = New Date(30) {}
Dim i As Integer = 0
Dim [date] = New DateTime(2020, 07, 01)
While [date] <= New DateTime(2020, 07, 31)
    dt(i) = [date]
    i += 1
    [date] = [date].AddDays(1)
End While
    
c1CalendarView1.BoldedDates = dt
c1CalendarView1.Theme.Day.Bolded.BackColor = Color.Green

Prabhat Sharma