Unable to add ItemMapping to SeriesMapping

3 posts, 1 answers
  1. Jeremy
    Jeremy avatar
    96 posts
    Member since:
    Mar 2010

    Posted 03 Dec 2010 Link to this post


    I have started creating a line chart in a new project using the following code and I get a weird error trying to add an ItemMapping to a SeriesMapping object. I had the chart working successfully with a DataSeries object, but I need to change to SeriesMapping apparently to use zoom + scroll properly.
    The error is: 'Telerik.Windows.Controls.Charting.ItemMappingCollection' does not contain a definition for 'seriesmap1' and no extension method 'seriesmap1' accepting a first argument of type 'Telerik.Windows.Controls.Charting.ItemMappingCollection' could be found (are you missing a using directive or an assembly reference?)  and is thrown on the last 2 lines below.
    SeriesMapping seriesmap1 = new SeriesMapping();
    seriesmap1.SeriesDefinition = new LineSeriesDefinition();
    seriesmap1.SeriesDefinition.Appearance.Stroke = new SolidColorBrush(Colors.Red);
    seriesmap1.SeriesDefinition.Appearance.PointMark.Fill = new SolidColorBrush(Colors.Transparent);
    seriesmap1.SeriesDefinition.Appearance.PointMark.Stroke = new SolidColorBrush(Colors.Transparent);
    seriesmap1.SeriesDefinition.ShowItemLabels = false;
    ItemMapping yMapping = new ItemMapping("NumberOfPeople", DataPointMember.YValue);
    ItemMapping xMapping = new ItemMapping("Height", DataPointMember.XValue);

    What am I doing wrong?
  2. Jeremy
    Jeremy avatar
    96 posts
    Member since:
    Mar 2010

    Posted 05 Dec 2010 Link to this post

    Worked it out! I changed the Target Silverlight Version in the project properties from Silverlight 3 to Silverlight 4 :)
  3. DevCraft R3 2016 release webinar banner
  4. Answer
    Yavor avatar
    11 posts

    Posted 07 Dec 2010 Link to this post

    Hi Jeremy,

    I am glad that you pinpointed the cause of the problem. I hope the sample is working as per your requirements now. If further questions arise, let us know.

    All the best,
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top