6 posts, 1 answers
  1. Andrew
    Andrew avatar
    37 posts
    Member since:
    Dec 2012

    Posted 05 Mar 2013 Link to this post


    I am struggling to include a  <telerik:RadLegendtag in my code. I have been using your documentation at http://www.telerik.com/help/wpf/radlegend-overview.html as a reference but always get an error message. 

    I have included a reference to Telerik.Windows.Controls.dll as well as including xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" as a namespace declaration in my XAML, but whenever I try to use a <telerik:RadLegendtag I get an error stating "The type 'telerik:RadLegend' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been build."

    Any help on this would be appreciated.


  2. Answer
    Goran avatar
    77 posts
    Member since:
    Feb 2011

    Posted 06 Mar 2013 Link to this post

    Hi Andrew,

    I am also having problems with RadLegend, but of other nature, so I bumped to your post while searching for information. Probably the reason that you receive such error is that you are having an older version of Telerik.Windows.Controls.dll referenced in your project. If I am not mistaken this control has been introduced in v2013_1_0220.

    Since RadLegend currently supports only ChartView controls, you will also need to add reference to Telerik.Windows.Controls.Chart.dll and Telerik.Windows.Data.dll.
  3. Andrew
    Andrew avatar
    37 posts
    Member since:
    Dec 2012

    Posted 07 Mar 2013 Link to this post

    Thanks, Goran.

    That was indeed the problem. I'd read in another forum post that the control was introduced Q4 2012, which is when we got the dlls. Updating to the latest dlls sorted the problem and I can now show legends with my pie charts. 

    However I am now having another problem. I am populating my chart by binding the Item Source and setting the value and label of each section of the pie chart. Now whenever I set up a legend the legend labels only showing the percentages and I can't find a way of setting them to show the chart labels. Is there a way to set up the legend so that it shows the same labels I set on the chart?

    Here is an example of what I'm trying to do: 

    <telerik:RadPieChart x:Name="StatusChart" Palette="Metro">
            <telerik:ChartSelectionBehavior DataPointSelectionMode="Single" />
        <telerik:PieSeries Name="statusChartSeries" ItemsSource="{Binding}" ShowLabels="True">
                <telerik:DataPointLegendSettings />
                <telerik:PropertyNameDataPointBinding PropertyName="Value"/>
                        <telerik:PropertyNameDataPointBinding PropertyName="Name" />
    <telerik:RadLegend Name="statusChartLegend" Items="{Binding ElementName=StatusChart, Path=LegendItems}"
                HorizontalAlignment="Left"  VerticalAlignment="Bottom" />

    I have tried to set up the binding of the Legend in a similar way to the chart values and labels, using telerik:RadLegend.Items but they don't seem to have a telerik:PropertyNameDataPointBinding value. 

    Any pointers?

  4. Goran
    Goran avatar
    77 posts
    Member since:
    Feb 2011

    Posted 07 Mar 2013 Link to this post

    Hi Andrew,

    RadLegend contains ItemTemplate property, which you can use for this purpose.You can access your custom type Name property using Presenter.DataItem.Name.

    What I am having problems with, is that if a number of items is dynamically changed in the PieChart (Example from 5 slices to 4), RadLegend will still show 5 items, while PieChart will show 4).

  5. Nurali
    Nurali avatar
    16 posts
    Member since:
    Oct 2010

    Posted 15 Jul 2013 Link to this post

    I was facing off with this error when I was using standard telerik namespace. 

    Then I changed it to 

    now it works.


    My All dll's version is 2013.2.611.40
  6. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 16 Jul 2013 Link to this post


    Andrew, perhaps you can use the TitleBinding property of the DataPointLegendSettings:
    <telerik:DataPointLegendSettings TitleBinding="Name" />

    Petar Marchev
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top