Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Calendar > Remove weekend days?

Not answered Remove weekend days?

Feed from this thread
  • Greg avatar

    Posted on Mar 14, 2011 (permalink)

    I'm using the Calendar along with the ScheduleView and I need to show weekdays only, NO weekends.  I can't figure out how to get rid of these days.  They need to be removed and they should not be accessible when using the forward and back buttons on the scheduleview.  Any ideas?

    Thanks,
    Greg

    Reply

  • Yana Yana admin's avatar

    Posted on Mar 17, 2011 (permalink)

    Hi Greg,

    You can achieve this in WeekViewDefinition by setting VisibleDays and FirstDayOfWeek properties like this:

    <telerik:RadScheduleView.ViewDefinitions>              
        <telerik:WeekViewDefinition VisibleDays="5" FirstDayOfWeek="Monday" />
    </telerik:RadScheduleView.ViewDefinitions>

    Let us know whether this helps.

    Kind regards,
    Yana
    the Telerik team

    Reply

  • Greg avatar

    Posted on Mar 17, 2011 (permalink)

    Thanks but I left some info out.  We are only showing single days in the schedule view and what you have suggested is for a week view.  Also, it would be nice to get rid of the entire Saturday/Sunday columns in the calendar.  Right now I have disabled the weekend days using the day template selector but that isn't exactly what we wanted to do but it should be ok.

    Thanks for the reply,
    Greg

    Reply

  • Yana Yana admin's avatar

    Posted on Mar 23, 2011 (permalink)

    Hello Greg,

    You can also subscribe to VisibleRangeChanged event and change the CurrentDate of RadScheduleView when it navigates to Saturday or Sunday. Here is a sample code:

    private void scheduleView_VisibleRangeChanged(object sender, EventArgs e)
    {
        var dayOfWeek = scheduleView.VisibleRange.Start.DayOfWeek;
        if (dayOfWeek.Equals(DayOfWeek.Saturday))
        {
            Dispatcher.BeginInvoke((Action)(() => {
                scheduleView.CurrentDate = scheduleView.CurrentDate.AddDays(2);
            }));
        }
        if (dayOfWeek.Equals(DayOfWeek.Sunday))
        {
            Dispatcher.BeginInvoke((Action)(() =>
            {
                scheduleView.CurrentDate = scheduleView.CurrentDate.AddDays(-2);
            }));
        }
    }


    Kind regards,
    Yana
    the Telerik team

    Reply

  • Greg avatar

    Posted on Mar 25, 2011 (permalink)

    Thanks Yana!  I'll give that a try.

    Thanks,
    Greg

    Reply

  • Santhosh avatar

    Posted on Jun 3, 2011 (permalink)

    Hi, is this possible in the month view - show only working days, no Saturday, Sundays.

    Thanks,
    Santhosh

    Reply

  • Yana Yana admin's avatar

    Posted on Jun 3, 2011 (permalink)

    Hi Santhosh,

    I'm afraid that you cannot remove the weekend days from MonthView. I would suggest to make them read-only using SpecialSlotsSource property of the ScheduleView. Please check this help article for more details.

    Greetings,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Santhosh avatar

    Posted on Jun 3, 2011 (permalink)

    Thanks Yana. 

    Do you have any plans to include such a feature in the near future. Let me know.

    -Santhosh

    Reply

  • Yana Yana admin's avatar

    Posted on Jun 6, 2011 (permalink)

    Hello Santhosh,

    Currently we don't have plans to implement this feature, but I've logged it and it will be considered for future releases.

    Regards,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Thomas Mutzl avatar

    Posted on Sep 6, 2011 (permalink)

    Just wanted to let you know, that we would need that feature (monthview without weekends), too.

    cheers,
    Thomas

    Reply

  • Yana Yana admin's avatar

    Posted on Sep 7, 2011 (permalink)

    Hello Thomas,

    Thank you for sending your feedback.

    All the best,
    Yana
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Calendar > Remove weekend days?
Related resources for "Remove weekend days?"

WPF Calendar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]