Scheduler Dates

Hello,

I have a scheduler control that displays 5 days at a time (week) and hides weekends. I would like the advance controls to move forward 5 days instead of one day. Is there any way to do this that I'm missing?

Thanks,

James

3 Replies

GB Gokul B Syncfusion Team June 20, 2007 11:59 PM UTC

Hi James,

Attached is the sample as per your requirement. In our sample we have advance the date to forward 5 days from the date displayed once the VisibleDay button of the Scheduler control is pressed.

http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/F62715/Scheduler_Inc62715/main.htm

* We have acheived this behaviour using the Scheduler control "CheckVisibleDay" event.
* We used Session variable to persist the advanced date to take effect on Page reload.

Let us know if our sample helps.

Thanks for using syncfusion products.

Regards,
Gokulkumar B


JT James Thomas June 22, 2007 11:16 PM UTC

This actually doesn't work when going back - it just advances 5 days regardless (I realized after I sent this that I actually wanted it to advance 7 but that's not a big deal). The CheckVisibleDayEventArgs does not have an option for which direction was clicked.

Any thoughts?


JT James Thomas June 23, 2007 01:20 AM UTC

I actually got this to work by overloading using the StartDateChanged event as follows:

protected void Scheduler1_StartDateChanged(object sender, StartDateChangedEventArgs e)
{
if (e.OldStartDate < Scheduler1.StartDate) // Moving forward
Scheduler1.StartDate = AdjustDateToMonday(Scheduler1.StartDate, true);
else // Moving backward
Scheduler1.StartDate = AdjustDateToMonday(Scheduler1.StartDate, false);
}

AdjustDateToMonday simply takes the date and adds (or subtracts) the correct number of days so we always wind up on a Monday when going forward or backwards.

Loader.
Up arrow icon