SmallChange and zooming with MouseWheel

5 posts, 0 answers
  1. Josh Eastburn
    Josh Eastburn avatar
    32 posts
    Member since:
    Aug 2012

    Posted 19 Dec 2012 Link to this post

    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
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 21 Dec 2012 Link to this post

    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.

  3. DevCraft banner
  4. Josh Eastburn
    Josh Eastburn avatar
    32 posts
    Member since:
    Aug 2012

    Posted 21 Dec 2012 Link to this post

    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
  5. Josh Eastburn
    Josh Eastburn avatar
    32 posts
    Member since:
    Aug 2012

    Posted 27 Dec 2012 Link to this post

    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.
  6. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 28 Dec 2012 Link to this post

    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.

Back to Top
DevCraft banner