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

ScrollntoView not Working

3 Answers 69 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Sébastien
Top achievements
Rank 1
Sébastien asked on 05 Oct 2011, 08:53 PM
Hi !

I've got a simple project with a ScheduleView in the MainWindow. The constructor code is as follows:

public MainWindow()
        {
            InitializeComponent();

            m_scheduleView.AppointmentsSource = new List<Appointment>();

            // Init the schedule view
            m_scheduleView.ViewDefinitions.Add(
                new WeekViewDefinition()
                {
                    FirstDayOfWeek = DayOfWeek.Sunday,
                    VisibleDays = 7,
                    TimerulerMajorTickStringFormat = "{0:H:mm}"
                } );
            m_scheduleView.ViewDefinitions.Add(
                new MonthViewDefinition()
                {
                    FirstDayOfWeek = DayOfWeek.Sunday
                } );

            // Make the beginning of the schedule read-only.
            var excludedRange = new ObservableCollection<Slot>();
            excludedRange.Add( new Slot( DateTime.MinValue, new DateTime( 2011, 10, 22 ) ) { IsReadOnly = true } );
            m_scheduleView.SpecialSlotsSource = excludedRange;

            m_scheduleView.ScrollIntoView( new Slot( new DateTime( 2011, 10, 23 ), new DateTime( 2011, 10, 24 ) ) );
        }


What I'm trying to do here is make the schedule read-only up to a certain date, then scroll the following day into view.
However, the last line, where I attempt to scroll a date into view, doesn't work.

Am I missing something or was this broken in SP1 ?

Thanks,
Sebastien

3 Answers, 1 is accepted

Sort by
0
Accepted
Rosi
Telerik team
answered on 10 Oct 2011, 01:57 PM
Hi Sébastien,

ScrollIntoView works with the current view only and this method does not change the visible days in the view.To complete the task I suggest you set the CurrentDate property.
For example:
ScrollIntoView.CurrentDate =new DateTime( 2011, 10, 23 );

Kind regards,
Rosi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Sébastien
Top achievements
Rank 1
answered on 12 Oct 2011, 06:18 PM
Thanks a lot that worked !
0
Idan
Top achievements
Rank 1
answered on 31 Oct 2011, 12:19 PM
Didn't work for me...
I opened a different thread about this issue here.

Idan.
Tags
ScheduleView
Asked by
Sébastien
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Sébastien
Top achievements
Rank 1
Idan
Top achievements
Rank 1
Share this question
or