Collapsed RangeBarSeries throw exception when selection behavior is present

6 posts, 0 answers
  1. LOUGE
    LOUGE avatar
    12 posts
    Member since:
    Jun 2010

    Posted 19 Dec 2012 Link to this post

    Executing this code throw an exeption :

    <telerik:RadCartesianChart >
     
        <telerik:RadCartesianChart.HorizontalAxis>
            <telerik:CategoricalAxis GapLength="0" />
        </telerik:RadCartesianChart.HorizontalAxis>
     
        <telerik:RadCartesianChart.VerticalAxis>
            <telerik:LinearAxis />
        </telerik:RadCartesianChart.VerticalAxis>
     
        <telerik:RadCartesianChart.Grid>
            <telerik:CartesianChartGrid MajorLinesVisibility="Y" />
        </telerik:RadCartesianChart.Grid>
     
        <telerik:RadCartesianChart.SelectionPalette>
            <telerik:ChartPalette>
                <telerik:ChartPalette.GlobalEntries>
                    <telerik:PaletteEntry Fill="Orange" />
                </telerik:ChartPalette.GlobalEntries>
            </telerik:ChartPalette>
        </telerik:RadCartesianChart.SelectionPalette>
     
        <telerik:RadCartesianChart.Behaviors>
            <telerik:ChartSelectionBehavior />
        </telerik:RadCartesianChart.Behaviors>
     
        <telerik:RangeBarSeries  ItemsSource="{Binding Items}"
                                 LowBinding="Min"
                                 HighBinding="Max"
                                 CategoryBinding="X"
                                 CombineMode="Cluster" />
     
     
        <telerik:RangeBarSeries ItemsSource="{Binding Items2}"
                                LowBinding="Min"
                                HighBinding="Max"
                                CategoryBinding="X"
                                CombineMode="Cluster"
                                Visibility="Collapsed" />
     
    </telerik:RadCartesianChart>

    If Visibility is sets to Hidden everithing works as expected.
    Setting Opacity to 0 doesn't work (the bar is visible), it's normal or not ?

    The stack trace is :
    à System.Windows.Media.VisualTreeHelper.HitTest(Visual reference, HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
     à Telerik.Windows.Controls.VisualTreeHelperExtensions.GetElementsInHostCoordinates[T](UIElement subtree, HitTestParameters hitTestParams) dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Common\VisualTreeHelperExtensions.cs:ligne 141
     à Telerik.Windows.Controls.VisualTreeHelperExtensions.GetElementsInHostCoordinates[T](UIElement subtree, Rect localIntersectingRect) dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Common\VisualTreeHelperExtensions.cs:ligne 134
     à Telerik.Windows.Controls.ChartView.ChartSeries.<HitTestElementsCore>d__c.MoveNext() dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartSeries.Behavior.cs:ligne 158
     à Telerik.Windows.Controls.ChartView.ChartSeries.<HitTestDataPointsCore>d__14.MoveNext() dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartSeries.Behavior.cs:ligne 176
     à Telerik.Windows.Controls.ChartView.ChartSeries.<HitTestDataPoints>d__0.MoveNext() dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartSeries.Behavior.cs:ligne 122
     à Telerik.Windows.Controls.ChartView.ChartSelectionBehavior.UpdateDataPointSelection(ChartSeries series) dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartSelectionBehavior.Branch.cs:ligne 346
     à Telerik.Windows.Controls.ChartView.ChartSelectionBehavior.UpdateSelection() dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartSelectionBehavior.Branch.cs:ligne 267
     à Telerik.Windows.Controls.ChartView.ChartSelectionBehavior.DoSelection(Point location) dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartSelectionBehavior.Branch.cs:ligne 221
     à Telerik.Windows.Controls.ChartView.ChartSelectionBehavior.AdornerContainerMouseLeftButtonUp(Object sender, MouseButtonEventArgs e) dans c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartSelectionBehavior.Branch.cs:ligne 210
     à System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
     à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
     à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
     à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
     à System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
     à System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
     à System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
     à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
     à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
     à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
     à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
     à System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
     à System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
     à System.Windows.Input.InputManager.ProcessStagingArea()
     à System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
     à System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
     à System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
     à System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
     à System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
     à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
     à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
     à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
     à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
     à System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
     à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
     à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
     à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
     à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
     à System.Windows.Threading.Dispatcher.Run()
     à System.Windows.Application.RunDispatcher(Object ignore)
     à System.Windows.Application.RunInternal(Window window)
     à System.Windows.Application.Run(Window window)
     à System.Windows.Application.Run()
     à TelerikChartViewSelection.App.Main() dans E:\Documents\Visual Studio 2010\Projects\TelerikChartViewSelection\obj\x86\Debug\App.g.cs:ligne 0
     à System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
     à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
     à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
     à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
     à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     à System.Threading.ThreadHelper.ThreadStart()





  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 21 Dec 2012 Link to this post

    Hi,

    Thank you for the provided code, we can confirm that this is indeed an issue in the chart, that has been logged for our developers to debug and provide a fix for one of the future versions of the control. We have updated your Telerik points for the feedback.

    Greetings,
    Nikolay
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Leland
    Leland avatar
    4 posts
    Member since:
    Oct 2011

    Posted 07 Oct 2014 in reply to Nikolay Link to this post

    I have confirmed that this is still a bug in 2014.1.331.40
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 08 Oct 2014 Link to this post

    Hi Leland,

    I have just tested this and I ca assure you that the bug was fixed a long time ago. There is no exception with the latest internal assemblies we have and assemblies from 2014.1.331.

    I have attached the project I tested with for a reference, so that you can test. I used exactly 2014.1.331.40 dlls and everything works correctly on my machine. Do run it and see how it goes.

    Perhaps you are dealing with another bug. You can see what are the differences between the project and your actual application and try to look for where the issue might be hiding. If you need further assistance, I will ask that you send to us a small project that demonstrates the issue at hand so that we can look into it.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Leland
    Leland avatar
    4 posts
    Member since:
    Oct 2011

    Posted 08 Oct 2014 in reply to Petar Marchev Link to this post

    Well, my experience is different. I was ready to give up on the functionality of selecting a rangebarseries, until I stumbled upon this post. I changed my visibility converter from a Collapsed to a Hidden and all miraculously works as expected. 

    Here is my xaml if you are interested.

    <telerik1:RadCartesianChart x:Name="RadCartesianChart" ClipToBounds="False" Margin="0,40,0,0" Visibility="{Binding ElementName=paredoOn, Path=IsChecked, Converter={conv:BoolToOppositeVisibilityHiddenConverter}}">

                            <telerik1:RadCartesianChart.Behaviors>
                                <telerik1:ChartSelectionBehavior DataPointSelectionMode="Single">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="SelectionChanged">
                                            <mvvm:EventToCommand Command="{Binding BarChartSelectionChangedCommand}" PassEventArgsToCommand="True"/>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </telerik1:ChartSelectionBehavior>
                            </telerik1:RadCartesianChart.Behaviors>

                            <telerik1:BarSeries ItemsSource="{Binding FeatureDiffsFiltered}"
                                                CombineMode="None"
               CategoryBinding="Name"
                                                ValueBinding="WeldConfidencePercent"
               ShowLabels="True"
               FontFamily="Segoe UI"
               FontSize="10"
                                                Foreground="Gray" Style="{StaticResource BarSeriesStyle1}"
                                                ClipToPlotArea="False"
                                                Visibility="{Binding ElementName=graphOptionWeldConfidencePercent, Path=IsChecked, Converter={conv:BoolToVisibilityHiddenConverter}}"
                                                Cursor="Hand"
                                                >
                                
                                <telerik1:BarSeries.LabelDefinitions>
                                    <telerik1:ChartSeriesLabelDefinition HorizontalAlignment="Center"  VerticalAlignment="Top"/>
                                </telerik1:BarSeries.LabelDefinitions>
                                
                            </telerik1:BarSeries>

                            <telerik1:RangeBarSeries ItemsSource="{Binding FeatureDiffsFiltered}"
                                                     CombineMode="None"
                    CategoryBinding="Name"
                    ShowLabels="False"
                    FontFamily="Segoe UI"
                    FontSize="10"
                                                     Foreground="Gray" Style="{StaticResource RangeBarSeriesStyle1}"
                                                     Visibility="{Binding ElementName=graphOptionWeldConfidencePercent, Path=IsChecked, Converter={conv:BoolToOppositeVisibilityHiddenConverter}}"
                                                     Cursor="Hand"
                                                     >
                                
                                
                                <telerik1:RangeBarSeries.LabelDefinitions>
                                    <telerik1:ChartSeriesLabelDefinition HorizontalAlignment="Center" VerticalAlignment="Top"/>
                                </telerik1:RangeBarSeries.LabelDefinitions>

                                <telerik2:RangeBarSeries.LowBinding>
                                    <MultiBinding Converter="{conv:WeldCompareBarChartLowBindingConverter}">
                                        <Binding ElementName="LayoutRoot" Path="DataContext.LastFocusedRow.Name"/>
                                        <Binding ElementName="graphOptionUnit" Path="IsChecked"/>
                                        <Binding ElementName="graphOptionPercent" Path="IsChecked"/>
                                        <Binding ElementName="graphOptionWeldConfidencePercent" Path="IsChecked"/>
                                    </MultiBinding>
                                </telerik2:RangeBarSeries.LowBinding>

                                <telerik2:RangeBarSeries.HighBinding>
                                    <MultiBinding Converter="{conv:WeldCompareBarChartHighBindingConverter}">
                                        <Binding ElementName="LayoutRoot" Path="DataContext.LastFocusedRow.Name"/>
                                        <Binding ElementName="graphOptionUnit" Path="IsChecked"/>
                                        <Binding ElementName="graphOptionPercent" Path="IsChecked"/>
                                        <Binding ElementName="graphOptionWeldConfidencePercent" Path="IsChecked"/>
                                    </MultiBinding>
                                </telerik2:RangeBarSeries.HighBinding>
                                
                            </telerik1:RangeBarSeries>
                            
                            <telerik1:PointSeries ItemsSource="{Binding FeatureDiffsFiltered}"
                                                  CombineMode="Cluster"
                 CategoryBinding="Name"
                 ShowLabels="True"
                 FontFamily="Segoe UI"
                 FontSize="10"              
                                                  Foreground="Black" 
                                                  Style="{StaticResource PointSeriesStyle1}"
                                                  Visibility="{Binding ElementName=graphOptionWeldConfidencePercent, Path=IsChecked, Converter={conv:BoolToOppositeVisibilityHiddenConverter}}"
                                                  Cursor="Hand">
                                
                                <telerik2:PointSeries.ValueBinding>
                                    <MultiBinding Converter="{conv:WeldCompareBarChartValueBindingConverter}">
                                        <Binding ElementName="LayoutRoot" Path="DataContext.LastFocusedRow.Name"/>
                                        <Binding ElementName="graphOptionUnit" Path="IsChecked"/>
                                        <Binding ElementName="graphOptionPercent" Path="IsChecked"/>
                                        <Binding ElementName="graphOptionWeldConfidencePercent" Path="IsChecked"/>
                                    </MultiBinding>
                                </telerik2:PointSeries.ValueBinding>
                                
                                <telerik1:PointSeries.LabelDefinitions>
                                    <telerik1:ChartSeriesLabelDefinition HorizontalAlignment="Center" Format="{} {0:F1}"/>
                                </telerik1:PointSeries.LabelDefinitions>
                                
                            </telerik1:PointSeries>

                            <telerik1:RadCartesianChart.HorizontalAxis>
                                <telerik1:CategoricalAxis FontFamily="Segoe UI"
      FontSize="12"
       >
                                    <telerik1:CategoricalAxis.LabelTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Converter={conv:FeatureToUnitsShortConverter}}" Foreground="{Binding Converter={conv:FeatureToBrushConverter}}" Margin="4"/>
                                        </DataTemplate>
                                    </telerik1:CategoricalAxis.LabelTemplate>
                                </telerik1:CategoricalAxis>
                            </telerik1:RadCartesianChart.HorizontalAxis>

                            <telerik1:RadCartesianChart.VerticalAxis>
                                <telerik1:LinearAxis x:Name="barChartVerticalAxis"
                                                    FontFamily="Segoe UI"
               FontSize="10"
               Minimum="{Binding BarChartAxisYMin}"
               Maximum="{Binding BarChartAxisYMax}"
                                                    Title="Global Differences" 
                                                    LabelStyle="{StaticResource ChartViewLabelStyle}" />
                            </telerik1:RadCartesianChart.VerticalAxis>

                            <telerik1:RadCartesianChart.Annotations>
                                <telerik2:CartesianGridLineAnnotation 
                                                         Axis="{Binding ElementName=barChartVerticalAxis}"
                                                         Value="0"
                                                         StrokeThickness="1.5" Stroke="#98FB98" ZIndex="-1000"/>
                            </telerik1:RadCartesianChart.Annotations>

                        </telerik1:RadCartesianChart>
  7. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 09 Oct 2014 Link to this post

    Leland,

    First I would like to know if you tested the project I sent in my previous post. Do you get an exception when you run it?

    I have now attached a second project. In it I have used the xaml you sent. Well, since you sent your xaml only, many things were missing and I had to delete some code in order to get it to work. Finally, I got it working and selection is done, no exception is thrown and a command is invoked when selection changes. Do test this and let us know how it goes.

    The original issue in this thread was that if there was a present Collapsed series, the selection behavior threw an exception upon mouse click. If you get a different error, please open a new thread so that issues are isolated, this will make communication easier.

    If you still experience issues with this, I will ask that you modify the project I attached, and send it back to us for investigation. Thank you for understanding.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready