Select start and end date scheduleview

2 posts, 0 answers
  1. Joeri
    Joeri avatar
    2 posts
    Member since:
    Oct 2011

    Posted 13 Oct 2011 Link to this post

    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

  2. Joeri
    Joeri avatar
    2 posts
    Member since:
    Oct 2011

    Posted 13 Oct 2011 Link to this post

    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!

  3. DevCraft banner
Back to Top