This is a migrated thread and some comments may be shown as answers.

Remove weekend days?

10 Answers 315 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 14 Mar 2011, 09:48 PM
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

10 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 17 Mar 2011, 04:08 PM
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
0
Greg
Top achievements
Rank 1
answered on 17 Mar 2011, 07:30 PM
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
0
Yana
Telerik team
answered on 23 Mar 2011, 03:30 PM
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
0
Greg
Top achievements
Rank 1
answered on 25 Mar 2011, 02:56 PM
Thanks Yana!  I'll give that a try.

Thanks,
Greg
0
Santhosh
Top achievements
Rank 1
answered on 03 Jun 2011, 08:59 AM
Hi, is this possible in the month view - show only working days, no Saturday, Sundays.

Thanks,
Santhosh
0
Yana
Telerik team
answered on 03 Jun 2011, 02:03 PM
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
0
Santhosh
Top achievements
Rank 1
answered on 03 Jun 2011, 02:16 PM
Thanks Yana. 

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

-Santhosh
0
Yana
Telerik team
answered on 06 Jun 2011, 08:01 AM
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
0
Thomas
Top achievements
Rank 1
answered on 06 Sep 2011, 03:55 PM
Just wanted to let you know, that we would need that feature (monthview without weekends), too.

cheers,
Thomas
0
Yana
Telerik team
answered on 07 Sep 2011, 06:44 AM
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 >>

Tags
Calendar
Asked by
Greg
Top achievements
Rank 1
Answers by
Yana
Telerik team
Greg
Top achievements
Rank 1
Santhosh
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Share this question
or