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

SmallChange and zooming with MouseWheel

4 Answers 93 Views
TimeLine
This is a migrated thread and some comments may be shown as answers.
Josh Eastburn
Top achievements
Rank 1
Josh Eastburn asked on 19 Dec 2012, 08:55 PM
In my RadTimeline implementation, I am using Hours and grouped Minute intervals.  When using the mouse wheel to zoom in, it seems like the SmallChange property is not being used.
From a full zoom out, the first few clicks of the mouse scroll wheel seem to zoom in by about an hour each time, but once I get about 50% of the way scrolled in, the scrolling increment seems to get very small.  Rather than zooming in by 1 hour increments, it is zooming by 1 minute increments.  At this level, it takes lots and lots of scrolling to get the current view from 6 hours down to 1 hour.

Resizing the scrollbar works fine and I'm able to quickly zoom in all the way, but the mouse wheel is nearly unusable.

Is there a change I can make to resolve this or is this a bug?

<telerik:RadTimeline x:Name="timelineControl"
                     PeriodStart="{Binding TimelinePeriodStart, Mode=TwoWay}"
                     PeriodEnd="{Binding TimelinePeriodEnd, Mode=TwoWay}"
                     StartPath="StartTime"
                     DurationPath="Duration"
                     GroupPath="ItemId"
                     GroupExpandMode="None"
                     ItemsSource="{Binding TimelineItems}"
                     ItemTemplateSelector="{StaticResource timelineTemplateSelector}"
                     SmallChange="1:00:00">
    <telerik:RadTimeline.Intervals>
        <telerik:HourInterval/>
        <telerik:MinuteInterval IntervalSpans="5,10,30,60"/>
    </telerik:RadTimeline.Intervals>

Thanks,
Josh

4 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 21 Dec 2012, 04:29 PM
Hello Josh,

This is actually by design. The SmallChange property of the RadTimeline control is for internal purposes only and is not intended to be set by developers.

Currently, the only way to change the zoom behavior and make it not aware of the current zoom level, is to use the following trick:

<telerik:RadTimeline PeriodStart="2011-01-01"
    PeriodEnd="2012-01-01"
    VisiblePeriodStart="2011-01-01"
    VisiblePeriodEnd="2011-02-01"
    StartPath="StartDate"
    DurationPath="Duration"
    ItemsSource="{Binding TimelineItems}"
    SmallChange="{Binding CustomSmallChange, Mode=TwoWay}"

public TimeSpan CustomSmallChange
{
    get
    {
        return TimeSpan.FromHours(1);
    }
    set
    {
        this.OnPropertyChanged("CustomSmallChange");
    }
}

Please note, that this is not supported by the control and you should test your application thoroughly in case you decide to use it. Additionally, you should test this code in case you decide to upgrade in the future.

Greetings,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Josh Eastburn
Top achievements
Rank 1
answered on 21 Dec 2012, 04:35 PM
Thanks for the workaround.  I will give this a try.
For future releases, can I suggest that the current behavior be reviewed?  It seems like the SmallChange / ScrollWheel zoom level is set by the CurrentItemInterval, so if the item interval is in minutes, each SmallChange is a minute which takes a very long time to zoom in if you are showing 2 hours with 5,10,30, and 60 MinuteInterval spans.

Thanks!
Josh
0
Josh Eastburn
Top achievements
Rank 1
answered on 27 Dec 2012, 03:29 PM
An update on this workaround.  I implemented the SmallChange binding as you suggested, and while the SET is called on the property as I zoom in, the GET is never called after the initial load.  So the control is calling SET to change the SmallChange value, but even with the OnPropertyChanged() call, it does not fetch my hard-coded CustomSmallChange value.
0
Tsvetie
Telerik team
answered on 28 Dec 2012, 04:02 PM
Hi Josh,

I have attached a test page, demonstrating the suggestion. In case the code does not help you, please open a formal support ticket and send me a running test project, demonstrating the problem.

Kind regards,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TimeLine
Asked by
Josh Eastburn
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Josh Eastburn
Top achievements
Rank 1
Share this question
or