Binding Problems with PanZoomBar SelectionStart and SelectionEnd

4 posts, 2 answers
  1. Josh
    Josh avatar
    6 posts
    Member since:
    Jun 2009

    Posted 02 Nov 2012 Link to this post

    I am using Q3 2012 version.
    Since upgrading to the new version, when I run the solution from VS, I get binding problems (unhandled exception error) trying to set the SelectionStart and SelectionEnd properties of the PanZoomBar.  If I set them directly to a value it runs fine.  I have a sample project, but I'm not sure how to attach the .zip file here.
    <UserControl.Resources>
        <Style TargetType="telerik:PanZoomBar">
            <!-- This is not working -->
            <!--<Setter Property="SelectionStart" Value="{Binding PanZoomBarSelectionStart, Mode=TwoWay}" />
            <Setter Property="SelectionEnd" Value="{Binding PanZoomBarSelectionEnd, Mode=TwoWay}" />-->
     
            <!-- This works -->
            <Setter Property="SelectionStart" Value=".2" />
            <Setter Property="SelectionEnd" Value=".85" />
        </Style>
    </UserControl.Resources>
  2. Answer
    Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 07 Nov 2012 Link to this post

    Hello Josh,

    Thank you for the code provided and pointing this issue out. I investigated this behavior and the reason for the chart not working in this scenario in the first place is caused by a bug in the panzoombar. As a gratitude to your finding your telerik points have now been updated.

    Here is a link to this bug in our Public Issue Tracker System so you could monitor its progress.

    Regarding your question about attaching zip files, as this is a public forum thread, you cannot upload zip files. However you could submit a ticket thread and attach a zip file there or  you could also  use a third party web site for files upload and share the attachment here.

    Greetings,
    Peshito
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 07 Nov 2012 Link to this post

    Hello Josh,

    I started investigating this issue. I used an old small project I had for this purpose (I used the new assemblies). I did try a few things but I was unable to reproduce any exception. If you can prepare a small project that reproduces this exception, please do open a support ticket and attach it so that we can look for solutions.

    When using an implicit style, as you have shown in your code snippet, both the vertical and horizontal axes are affected. This is because both of the axes have a PanZoomBar inside, even though the pan zoom bar might not be visible. So if you want to target only one axis, you can place the implicit style in the axis' resources:
    <telerik:DateTimeContinuousAxis.Resources>
     <Style TargetType="telerik:PanZoomBar">
      <Setter Property="SelectionStart" Value="{Binding PanZoomBarSelectionStart, Mode=TwoWay}" />
      ...

    Note that the purpose of this two-way-binding is not to set SelectionStart of the PanZoomBar, but only to notify the ViewModel what is the current value of the SelectionStart. This is because the chart internally sets and coerces the slider's values. If you need to control the zoom, you need to directly work with the Zoom property of the chart.

    Greetings,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Josh
    Josh avatar
    6 posts
    Member since:
    Jun 2009

    Posted 07 Nov 2012 Link to this post

    Moving the style to the HorizontalAxis worked for me.  Thanks for the suggestion.
Back to Top