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

How to set the VisibleRange in code?

4 Answers 99 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Meik Schuetz
Top achievements
Rank 1
Meik Schuetz asked on 08 Apr 2011, 12:20 PM
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).

Thanks 
Meik

4 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 08 Apr 2011, 01:11 PM
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?

Regards,
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
0
Meik Schuetz
Top achievements
Rank 1
answered on 08 Apr 2011, 06:12 PM
Valeri,
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,
Meik
0
Wade
Top achievements
Rank 1
answered on 30 Oct 2013, 05:15 PM
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?
0
Kalin
Telerik team
answered on 04 Nov 2013, 12:31 PM
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.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
Tags
ScheduleView
Asked by
Meik Schuetz
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Meik Schuetz
Top achievements
Rank 1
Wade
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or