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

System.Windows.Data Error: 4 : Cannot find source for binding with reference...

9 Answers 1086 Views
Chart
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 2
David asked on 04 May 2011, 10:50 AM
Hi,

When i debug the LiveData example for Q3 2010 controls, the following debug message is printed every time a new data point is added:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Telerik.Windows.Controls.Charting.ChartLegend', AncestorLevel='1''. BindingExpression:Path=LegendItemMarkerShape; DataItem=null; target element is 'ChartLegendItem' (Name=''); target property is 'MarkerShape' (type 'MarkerShape')


I'm getting the same error message when I use the same control in my project. Both the LiveData example and my project have explicitly set

ShowPointMarks="False"

in the series definition, therefore I'm uncertain why a debug message referencing LegendItemMarkerShape is being generated. Functionally, I'm not encountering any problems, but I'm uncertain whether I should be investigating this debug message. Any insight in what is causing these debug messages?

Kind regards,
Dave.

9 Answers, 1 is accepted

Sort by
0
Accepted
Yavor
Telerik team
answered on 09 May 2011, 07:39 AM
Hi David,

In Q3.2010 we have changed the mechanics for getting the marker shape of the legend item. These strange messages started to appear after that change and our developers tracked down and fixed the issue. You can get the fix in Q1.2011 SP1 or the latest build of Q1.2011. Please update your binaries accordingly and test if this output error appears again.

Greetings,
Yavor Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David
Top achievements
Rank 2
answered on 09 May 2011, 10:04 AM
Hi Yavor,

I can confirm that the Q1 2011 controls resolved the issued and I no longer receive the debug messages.

Kind regards,
Dave.
0
Christian
Top achievements
Rank 1
answered on 14 Sep 2011, 11:11 AM
Hi,
I get the same error with ver.  2011.2 712. And it's not fixed, isn't it?

I'm using this:
 
<telerik:RadChart ItemsSource="{Binding ConnectionItems, Mode=OneWay}">
    <telerik:RadChart.DefaultView>
        <telerik:ChartDefaultView ChartLegendPosition="Bottom">
            <telerik:ChartDefaultView.ChartArea>
                <telerik:ChartArea  LegendName="connLegend" />
            </telerik:ChartDefaultView.ChartArea>
            <telerik:ChartDefaultView.ChartLegend>
                <telerik:ChartLegend x:Name="connLegend" Header=""/>
            </telerik:ChartDefaultView.ChartLegend>
        </telerik:ChartDefaultView>
    </telerik:RadChart.DefaultView>
    <telerik:RadChart.SeriesMappings>
        <telerik:SeriesMapping>
            <telerik:SeriesMapping.SeriesDefinition>
                <telerik:PieSeriesDefinition>
                    <telerik:PieSeriesDefinition.LabelSettings>
                        <telerik:RadialLabelSettings ShowZeroValueLabels="False"/>
                    </telerik:PieSeriesDefinition.LabelSettings>
                </telerik:PieSeriesDefinition>
            </telerik:SeriesMapping.SeriesDefinition>
        </telerik:SeriesMapping>
    </telerik:RadChart.SeriesMappings>
</telerik:RadChart>
0
David
Top achievements
Rank 2
answered on 14 Sep 2011, 12:32 PM
Hi Christian,

As I previously answered and I have now reconfirmed with Q2 2011, I am no longer receiving the debug messages in the LiveData example or my own solution.

Your XAML doesn't show how data is being populated into the chart control (other than ItemsSource="{Binding ConnectionItems, Mode=OneWay}"). You'll need to provide the code you're using to populate the data to locate the problem you're encountering.

Kind regards,
Dave.
0
Yavor
Telerik team
answered on 19 Sep 2011, 12:16 PM
Hello Christian,

Unfortunately we couldn't reproduce the problem using the code snippet that you have provided. Can you please provide more code as David suggested?

Regards,
Yavor Ivanov
the Telerik team

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

0
Christian
Top achievements
Rank 1
answered on 21 Sep 2011, 08:00 AM

Hi,
here is the model for my example. I think the problem is ObservableCollection and adding the items manually...

public class Model
{
    public struct ConnectionItem
    {
        public int Count { get; set; }
        public string Description { get; set; }
        public string ToolTip { get { return string.Format("{0}: {1}", Description, Count); } }
    }
     
    ObservableCollection<ConnectionItem> _connectionItems = new ObservableCollection<ConnectionItem>();
    public ObservableCollection<ConnectionItem> ConnectionItems
    {
        get { return _connectionItems; }
    }
 
    public void Load()
    {
        for (int i = 1; i < 6; i++)
            _connectionItems.Add(new ConnectionItem { Count = i * 10, Description = "Test" + i });
    }
}


0
Yavor
Telerik team
answered on 22 Sep 2011, 11:46 AM
Hi Christian,

We created a small sample application using the code that you provided and unfortunately couldn't reproduce the output warnings problem. Can you please run the project in your environment and test for any warning messages in the Output?

Regards,
Yavor
the Telerik team

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

0
Christian
Top achievements
Rank 1
answered on 22 Sep 2011, 04:00 PM
hi,

yes it works in Silverlight but not in WPF. Just tested it with Q1 2011 SP1.
I got following error:

System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Telerik.Windows.Controls.Charting.ChartLegend', AncestorLevel='1''. BindingExpression:Path=LegendItemMarkerShape; DataItem=null; target element is 'ChartLegendItem' (Name=''); target property is 'MarkerShape' (type 'MarkerShape')

 


0
Yavor
Telerik team
answered on 27 Sep 2011, 12:05 PM
Hi Christian,

We have logged this in our PITS system here. The responsible team is already notified and it will be handled in a timely manner. The reason why this strange message doesn't appear always is because it depends on the scenario. We encourage everyone that experiences this problem to comment on it in our PITS system.

Greetings,
Yavor
the Telerik team

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

Tags
Chart
Asked by
David
Top achievements
Rank 2
Answers by
Yavor
Telerik team
David
Top achievements
Rank 2
Christian
Top achievements
Rank 1
Share this question
or