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

Binding Problems with PanZoomBar SelectionStart and SelectionEnd

3 Answers 112 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Josh
Top achievements
Rank 1
Josh asked on 02 Nov 2012, 03:22 PM
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>

3 Answers, 1 is accepted

Sort by
0
Accepted
Peshito
Telerik team
answered on 07 Nov 2012, 12:01 PM
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.

0
Accepted
Petar Marchev
Telerik team
answered on 07 Nov 2012, 04:04 PM
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.

0
Josh
Top achievements
Rank 1
answered on 07 Nov 2012, 08:33 PM
Moving the style to the HorizontalAxis worked for me.  Thanks for the suggestion.
Tags
Chart
Asked by
Josh
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Petar Marchev
Telerik team
Josh
Top achievements
Rank 1
Share this question
or