Remove weekend days?

11 posts, 0 answers
  1. Greg
    Greg avatar
    15 posts
    Member since:
    Nov 2010

    Posted 14 Mar 2011 Link to this post

    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
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 17 Mar 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Greg
    Greg avatar
    15 posts
    Member since:
    Nov 2010

    Posted 17 Mar 2011 Link to this post

    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
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 23 Mar 2011 Link to this post

    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
  6. Greg
    Greg avatar
    15 posts
    Member since:
    Nov 2010

    Posted 25 Mar 2011 Link to this post

    Thanks Yana!  I'll give that a try.

    Thanks,
    Greg
  7. Santhosh
    Santhosh avatar
    21 posts
    Member since:
    Oct 2010

    Posted 03 Jun 2011 Link to this post

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

    Thanks,
    Santhosh
  8. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 03 Jun 2011 Link to this post

    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
  9. Santhosh
    Santhosh avatar
    21 posts
    Member since:
    Oct 2010

    Posted 03 Jun 2011 Link to this post

    Thanks Yana. 

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

    -Santhosh
  10. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 06 Jun 2011 Link to this post

    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
  11. Thomas Mutzl
    Thomas Mutzl avatar
    39 posts
    Member since:
    Oct 2006

    Posted 06 Sep 2011 Link to this post

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

    cheers,
    Thomas
  12. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 07 Sep 2011 Link to this post

    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 >>

Back to Top
UI for WPF is Visual Studio 2017 Ready