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

10 posts, 1 answers
  1. David
    David avatar
    57 posts
    Member since:
    Apr 2011

    Posted 04 May 2011 Link to this post

    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.
  2. Answer
    Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 09 May 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    57 posts
    Member since:
    Apr 2011

    Posted 09 May 2011 Link to this post

    Hi Yavor,

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

    Kind regards,
    Dave.
  5. Christian
    Christian avatar
    52 posts
    Member since:
    Apr 2011

    Posted 14 Sep 2011 Link to this post

    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>
  6. David
    David avatar
    57 posts
    Member since:
    Apr 2011

    Posted 14 Sep 2011 Link to this post

    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.
  7. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 19 Sep 2011 Link to this post

    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 >>

  8. Christian
    Christian avatar
    52 posts
    Member since:
    Apr 2011

    Posted 21 Sep 2011 Link to this post

    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 });
        }
    }


  9. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 22 Sep 2011 Link to this post

    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 >>

  10. Christian
    Christian avatar
    52 posts
    Member since:
    Apr 2011

    Posted 22 Sep 2011 Link to this post

    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')

     


  11. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 27 Sep 2011 Link to this post

    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 >>

Back to Top
UI for WPF is Visual Studio 2017 Ready