ChartTrackBallBehavior.TrackInfoUpdated doesn't compile

4 posts, 0 answers
  1. Jesper
    Jesper avatar
    18 posts
    Member since:
    Jun 2012

    Posted 06 Jul 2012 Link to this post

    I'm currently trying to template the TrackBallInfo popup and in doing so I hoped to be able to use the behavior's "TrackInfoUpdated" event.

    This is the XAML:

    <chart:RadCartesianChart.Behaviors>
        <chartView:ChartPanAndZoomBehavior
            ZoomMode="Horizontal" />
        <chartView:ChartTrackBallBehavior
            ShowTrackInfo="True"
            ShowIntersectionPoints="True"
             TrackInfoUpdated="trackBallInfoUpdated" />
    </chart:RadCartesianChart.Behaviors>

    ... and here's the code behing event handler ...

    private void trackBallInfoUpdated(object sender, TrackBallInfoEventArgs e)
    {
        // exploring TrackBallInfoUpdated event ...
        foreach (var info in e.Context.DataPointInfos)
        {
            info.DisplayContent = "DataItem=" + info.DataPoint.DataItem;
        }
        e.Header = "Test Header";
    }

    When I build this I get this errors from the compiler:

    -----
    Error   5   The type or namespace name 'Windows' does not exist in the namespace 'Spike.Telerik' (are you missing an assembly reference?)   C:\Users\Jesper\Documents\Visual Studio 2010\Projects\Spike.Telerik.RadChartView\GvsDefectsChartControl.xaml    66  23  Spike.Telerik.RadChartView
    -----
    Error   6   The type or namespace name 'Windows' does not exist in the namespace 'Spike.Telerik' (are you missing an assembly reference?)   C:\Users\Jesper\Documents\Visual Studio 2010\Projects\Spike.Telerik.RadChartView\GvsDefectsChartControl.xaml    66  135 Spike.Telerik.RadChartView
    -----
    Error   7   No overload for 'EventHandler' matches delegate 'System.EventHandler<Windows.Controls.ChartView.TrackBallInfoEventArgs>'    C:\Users\Jesper\Documents\Visual Studio 2010\Projects\Spike.Telerik.RadChartView\GvsDefectsChartControl.xaml    66  103 Spike.Telerik.RadChartView

    The first two are quite surprising. So far as I've seen they only show up when I try using this event. The third error is just weird. I checked and double checked and the method seem to fully comply with the expected event handler signature. 

    Any assistance would be greatly appreciated!
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 11 Jul 2012 Link to this post

    Hello Jesper,

    Thank you for the attached code snippets, I was able to create a simple project with them. I have copy pasted your code and filled in the missing things, such as the namespaces chart and chartView. The project compiles and runs as expected. The only thing I can suggest for you to try is to make sure that the chart and chartView namespaces reference the Chart assembly and the ChartView namespace:
    <Window
    xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart"
    xmlns:chartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart" />
    or as in the attached project - the telerik schema.

    I have attached this small project to this post, so that you can download it and see if you get the same behavior. If you keep experiencing issues with this I will ask that you open a support ticket and provide us with a small project that reproduces these errors. 

    Greetings,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Jesper
    Jesper avatar
    18 posts
    Member since:
    Jun 2012

    Posted 12 Jul 2012 Link to this post

    Thank you for this suggestion. Unfortunately I still get the exact same compiler errors. I have tried using the assembly references as well as the Telerik schema but the result is the same.
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 16 Jul 2012 Link to this post

    Hello Jesper,

    You did not mention if the project that I had attaches compiled properly.

    I suspect that this is more of a dll problem, and not a code problem. Try to remove the assembly references and add them again. Also clean the project by  deleting the bin and obj folders.

    If this issue persists I will again ask that you open a new support ticket and provide us with a small project that reproduces this undesired behavior.

    All the best,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top