Articles in this section
Category / Section

How to customize the appearance of dates in the WinForms MonthCalenderAdv?

1 min read

Appearance and selection of date cell

The appearance and selection of a Date cell can be customized in the MonthCalenderAdv by handling the DateQueryCellInfo event. The following code example demonstrates the same.

C#

private void monthCalendarAdv1_DateCellQueryInfo(object sender, Syncfusion.Windows.Forms.Tools.DateCellQueryInfoEventArgs e)
{
   //Helps customize the MonthCalenderAdv DateCells.
   if (e.RowIndex == 3 && e.ColIndex > 2)
   {
      e.Style.BackColor = Color.Snow;
      //Disables Date cell selection.
      e.Style.Enabled = false;
      //Sets Unselectable Date cells BackColor.
      e.Style.BackColor = Color.FromArgb(13, 134, 64);
   }
}

 

VB

Private Sub monthCalendarAdv1_DateCellQueryInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Tools.DateCellQueryInfoEventArgs) Handles monthCalendarAdv1.DateCellQueryInfo
    'Helps customize the MonthCalenderAdv DateCells.
    If e.RowIndex = 3 AndAlso e.ColIndex > 2 Then
      e.Style.BackColor = Color.Snow
      'Disables Date cell selection.
      e.Style.Enabled = False
      'Sets Unselectable Date cells BackColor.
      e.Style.BackColor = Color.FromArgb(13, 134, 64)
    End If
End Sub

Customize the monthCalendarAdv

Figure 1: Customized MonthCalenderAdv

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/DisableDateInMonthCalenderAdv-382923870.zip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied