This is a migrated thread and some comments may be shown as answers.

error in aplying aggregate function when binding from datatable

3 Answers 189 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kapil
Top achievements
Rank 1
Kapil asked on 25 Aug 2010, 10:17 AM
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.SeriesMappings.Add(sm)
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?

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 27 Aug 2010, 09:51 AM
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
0
Kiran
Top achievements
Rank 1
answered on 24 Aug 2016, 11:00 AM
How do you do that in Javascript? 
0
Martin Ivanov
Telerik team
answered on 26 Aug 2016, 07:12 AM
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.
Tags
Chart
Asked by
Kapil
Top achievements
Rank 1
Answers by
Ves
Telerik team
Kiran
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or