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

       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.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
    Ves avatar
    2869 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 ,
    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. DevCraft R3 2016 release webinar banner
  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
    Martin avatar
    1042 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.

    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