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

Select start and end date scheduleview

1 Answer 93 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Joeri
Top achievements
Rank 1
Joeri asked on 13 Oct 2011, 09:22 AM

Hello,

I am working on a scheduleview where I can set manually the visible start en end date. So I can filter the appointments in my calendar.

What I would like to do is set manually the start date en set the end date of the calendar. I’ve already set the visibledays-property. But I would like to do something more.

So when I set via my external filter the startdate on September 1st and enddate on September 16th, I want to see all those days in my custom view.

<sdk:DatePicker x:Name="dtpFrom" SelectedDate="{Binding Path=FromDate, Mode=TwoWay}"/>
<sdk:DatePicker x:Name="dtpTo" SelectedDate="{Binding Path=ToDate, Mode=TwoWay}"/>

 

I’ve made a viewdefinition based on the WeekViewDefinition where I would like to show my selection. But is there any other property which can help me to set the visible-start date?

 

<scheduleView:WeekViewDefinition Title="MySelection" MinTimeRulerExtent="1" VisibleDays="{Binding VisibleDays}" DayStartTime="06:00:00" DayEndTime="20:00:00"/>

 

Thanks in advance,

Joeri

1 Answer, 1 is accepted

Sort by
0
Joeri
Top achievements
Rank 1
answered on 13 Oct 2011, 10:23 AM

I've solved this issue myself based on http://www.telerik.com/community/forums/silverlight/scheduleview/custom-visiblerange.aspx
I have made a custom class based on WeekViewDefinition. It declares 2 dependency properties which are binded to my filters.

public class CustomWeekViewDefinition : WeekViewDefinition
    {
        protected override DateTime GetVisibleRangeStart(DateTime dateTime, System.Globalization.CultureInfo culture,    DayOfWeek? firstDayOfWeek)
        {
            return StartDate;
        }
}
    

Thanks!

Tags
ScheduleView
Asked by
Joeri
Top achievements
Rank 1
Answers by
Joeri
Top achievements
Rank 1
Share this question
or