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

[Solved] Q2 Gridview Linq error

4 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonathan Miller
Top achievements
Rank 1
Jonathan Miller asked on 16 Jul 2009, 07:44 PM
Hey guys, any ideas on this - after upgrading GridView to Q2, getting this in code behind:

From this:   radGridView.ItemsSource = e.Result;
Getting this: No method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied arguments.

Here are the items from XAML:

<telerikdata:SumFunction FunctionName="TotalPaid" SourceField="PaidAmount" Caption="PayAmount:" ResultFormatString="{}{0:c}"/>

                                <telerikdata:SumFunction FunctionName="TotalWeight" SourceField="Weight" Caption="TotWeight:" ResultFormatString="{}{0:0.00}" />



4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Jul 2009, 05:13 AM
Hi Jonathan,

How the grid is bound in your case? Please provide a bit more info about your collection of business objects.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jonathan Miller
Top achievements
Rank 1
answered on 17 Jul 2009, 11:49 AM
Hi,
The binding object is an ObservableCollection from a WebService via the Interface listed below:

(only partial code listed)

public class DetailsReport

{

    [DataMember]

    public string PaidAmount;

    [DataMember]

    public string Weight;

}

0
Vlad
Telerik team
answered on 17 Jul 2009, 12:22 PM
Hello Jonathan,

PaidAmount property is string - you cannot execute Sum on string.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jonathan Miller
Top achievements
Rank 1
answered on 17 Jul 2009, 12:23 PM
Thanks.  At one point we had as a string (can't remember the reason why) and it worked with Q1 release using data formatting.  We'll convert to decimal and see if it resolves. Thanks for the reply
Tags
GridView
Asked by
Jonathan Miller
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jonathan Miller
Top achievements
Rank 1
Share this question
or