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

ChartTrackBallBehavior.TrackInfoUpdated doesn't compile

3 Answers 150 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Jesper
Top achievements
Rank 1
Jesper asked on 06 Jul 2012, 10:33 AM
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!

3 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 11 Jul 2012, 06:46 AM
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 >>

0
Jesper
Top achievements
Rank 1
answered on 12 Jul 2012, 11:25 AM
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.
0
Petar Marchev
Telerik team
answered on 16 Jul 2012, 11:35 AM
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.

Tags
ChartView
Asked by
Jesper
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Jesper
Top achievements
Rank 1
Share this question
or