We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Limit the number of days requested by the ScheduleDataProvider.GetSchedule(DateTime startDate, DateTime endDate) method

Thread ID:

Created:

Updated:

Platform:

Replies:

132225 Aug 21,2017 08:07 PM UTC Aug 22,2017 01:45 PM UTC Windows Forms 1
loading
Tags: ScheduleControl
Truth Seeker
Asked On August 21, 2017 08:07 PM UTC

Hi,

I am writing a custom ScheduleDataProvider and my calendar items source has a limit on the number of items it returns (62 maximum items). However, upon initialization, the ScheduleControl is issuing a call to the ScheduleDataProvider.GetSchedule(DateTime startDate, DateTime endDate) passing two dates where the difference is 70 days (7/30/2017 to 10/8/2017). Is there a way to limit the number of days it asks for? I was thinking I can ask it to show the calendar for one month only in the calendar navigator but it did not work (I don't think I got it to display one calendar).

Thanks.

Piruthiviraj Malaimelraj [Syncfusion]
Replied On August 22, 2017 01:45 PM UTC

Hi Truth, 

Thanks for your interest in Syncfusion products, 

We have created the simple sample as per your requirements. In order to get the notification when getting the schedules between the days, you can override the GetSchedule method of ScheduleDataProvider and check the total number schedules with number schedules between the days. Please make use of the below code, 

Code snippet: 
public override IScheduleAppointmentList GetSchedule(DateTime startDate, DateTime endDate) 
{ 
    ScheduleAppointmentList list = new ScheduleAppointmentList(); 
 
    double no_of_days = (endDate - startDate).TotalDays; 
    if (no_of_days > this.MasterList.Count) 
    { 
        if (MessageBox.Show("Enter valid dates to get the days", "", MessageBoxButtons.OK) == DialogResult.OK) 
        { 
            return list; 
        } 
    } 
   /// 
   /// 
   /// 
} 

Sample link: 

Please let us know if we misunderstood anything from your requirements. 

Regards, 
Piruthiviraj 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;