Articles in this section
Category / Section

Is it possible not to load Dates after current DateTime in SfCalendar?

1 min read

In SfCalendar control, MaxDate property helps you to restrict loading date not falling greater than its specified date. This option will be helpful in this case.


The following code demonstrates the same.


Code Example: [C#]


private void Form1_Load1(object sender, EventArgs e)
    // Set the MaxDate with Date and Time.
    this.sfCalendar.MaxDate = new System.DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 0, 0);



Code Example: [VB]


Private Sub Form1_Load1(ByVal sender As Object, ByVal e As EventArgs)
   ‘Set the MaxDate with Date and Time.
    Me.sfCalendar.MaxDate = New Date(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 0, 0)End Sub








C#: SfCalendar_C#


VB: SfCalendar_VB


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