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

Problem with calculated column

4 Answers 199 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zdeněk
Top achievements
Rank 1
Zdeněk asked on 02 Sep 2010, 12:42 PM
Hi,
I'm having problem with calculated column in RadGrid (2010-02).  Code:
...
<telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" UniqueName="colQuantity"></telerik:GridBoundColumn>
<
telerik:GridBoundColumn DataField="Price" HeaderText="Price" SortExpression="Price" UniqueName="colPrice" DataFormatString="{0:C}"></telerik:GridBoundColumn>
                           
<
telerik:GridCalculatedColumn  HeaderText="Total Cost" UniqueName="colTotalCost" DataType="System.Double" DataFields="Quantity, Price" Expression="{0}*{1}" />
...

Columns Price and Quantity are correct, without calculated column it is grid OK, but when I add it, I got cryptic error:

')' or ',' expected

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Telerik.Web.UI.ParseException: ')' or ',' expected


Can anybody tell me, what's wrong?

Thank you,
Zdenek

4 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 02 Sep 2010, 12:53 PM
Hello Zdenek,

Try setting EnableLinqExpressioins property to false for the grid - this should fix prevent the parsing exception.

I hope this helps.

Best wishes,
Pavlina
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
Zdeněk
Top achievements
Rank 1
answered on 02 Sep 2010, 01:02 PM


Thank you, it helps. A bit strange solution, isn't it? :-)

Zdeněk
0
Edney
Top achievements
Rank 1
answered on 07 Feb 2011, 07:43 PM
I am having the same issue but I am using Linq so this is not a valid solution for me.  Any other suggestions?
0
Pavlina
Telerik team
answered on 10 Feb 2011, 03:06 PM
Hello Zdenek,

In order to utilize LINQ expressions, you will need to define the RadGrid's FilterExpression in a different manner. Review the bottom section of this documentation topic for more details.

Kind regards,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Zdeněk
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Zdeněk
Top achievements
Rank 1
Edney
Top achievements
Rank 1
Share this question
or