How to set the VisibleRange in code?

5 posts, 0 answers
  1. Meik Schuetz
    Meik Schuetz avatar
    9 posts
    Member since:
    May 2010

    Posted 08 Apr 2011 Link to this post

    Dear all,
    by default, the SchedulerView initializes the VisibleRange accordingly to the current date/ time.
    Is there any way to set the visible time range in code behind (the VisibleRange, as well as VisibleRange.Start and VisibleRange.End properties are read-only).

  2. Valeri Hristov
    Valeri Hristov avatar
    2252 posts

    Posted 08 Apr 2011 Link to this post

    Hello Meik,

    The only way to control the VisibleRange from code-behind is by setting the CurrentDate and FirstDayOfWeek properties. Why is this not enough for you?

    Valeri Hristov
    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
  3. Meik Schuetz
    Meik Schuetz avatar
    9 posts
    Member since:
    May 2010

    Posted 08 Apr 2011 Link to this post

    thank you for your quick response - in my scenario I do have an non-Telerik calendar control which I need to synchronize with the Telerik SchedulerView - the visible range should always be the same. But you're right, the CurrentDate will do.

    Thanks again,
  4. Wade
    Wade avatar
    1 posts
    Member since:
    Oct 2013

    Posted 30 Oct 2013 Link to this post

    I have a calendar popup that returns a date as well as the number of days the user wants to view ahead on the timeline.

    So assuming the user selected a date, I would want the visible range to start at that date and go ahead the selected number of days, so that the user can scroll that in the scheduler, as opposed to clicking on the next 5 days arrow.

    is this possible?
  5. Kalin
    Kalin avatar
    1362 posts

    Posted 04 Nov 2013 Link to this post

    Hi Wade,

    You can achieve the desired scenario by setting CurrentDate of the ScheduleView (this will be the start date). And setting the VisibleDays of the TimelineViewDefinition afterwards (this will be the duration). For an example please check the following code snippet:

    private void Button_Click(object sender, RoutedEventArgs e)
        this.ScheduleView.CurrentDate = DateTime.Now.AddDays(3);
        // Assuming we have only a TimelineViewDefinition
        this.ScheduleView.ActiveViewDefinition.VisibleDays = 3;

    Hope this helps.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top