error in aplying aggregate function when binding from datatable

4 posts, 0 answers
  1. Kapil
    Kapil avatar
    15 posts
    Member since:
    Jul 2010

    Posted 25 Aug 2010 Link to this post

    I am getting error while supplying aggregate function and then setting itemssource property of chart to datatable...

    my code is like below..

    Snippet
       Dim sm As New SeriesMapping
            sm.SeriesDefinition = New LineSeriesDefinition
            sm.ItemMappings.Add(New ItemMapping("VDate"DataPointMember.XCategory))
            sm.ItemMappings.Add(New ItemMapping("Sales"DataPointMember.YValue, ChartAggregateFunction.Sum))
            rd.SeriesMappings.Add(sm)
    Snippet
    rd.ItemsSource = DataSetMain.Tables(3)

    Error i get...
    "No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic."

    Does that mean i cant use datatable which includes aggregate function or...if possible then then how?
  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 27 Aug 2010 Link to this post

    Hello Kapil,

    When databinding to DataTable you need to specify the field type explicitly:

    ItemMapping mapping = new ItemMapping("Sales", DataPointMember.YValue, ChartAggregateFunction.Sum);
    mapping.FieldType = typeof(double);


    Sincerely ,
    Ves
    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. kiran
    kiran avatar
    2 posts
    Member since:
    Jun 2016

    Posted 24 Aug Link to this post

    How do you do that in Javascript? 
  5. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 26 Aug Link to this post

    Hello Kiran,

    This is the UI for WPF forum and it concerns the controls created for the WPF framework which doesn't use javascript. If you want to have a chart in HTML and use javascript you can see the Kendo UI chart component and post your question in the corresponding Kendo UI Forum.

    Regards,
    Martin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top