Are you planning on supporting the Select statement, we are having problems when trying to run an aggregate on a child collection property? Or is there any other way around this?
You'll need to form your expression like so: "Average(Children.Select(Age))". Lambdas in the RadExpressionEditor syntax lack the "x => x." part of the C# syntax. Instead, identifiers are automatically resolved in the context of the lambda's parameter.
Greetings,
Yavor Georgiev
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
What other methods does the ExpressionEditor support, is the Cast<T>() operator supported, the problem we are facing is that we have an object (which is a double) that we want to take an Average of.
Average(articles.items.Select(Source.Columns[1].DataValue)) // does not seem to work as DataValue is of type object
Do you have any suggestions on how we may cast: Source.Columns[1].DataValue to a double?
Is there any documentation over which expressions that are supported?
/Mattias
0
Accepted
Yavor Georgiev
Telerik team
answered on 13 Jun 2011, 11:51 AM
Hello Mattias,
Generally, collections in RadExpressionEditor are treated as IQueryable (you can see that in the LambdaExpression the editor produces). Consequently, all the Queryeable extensions methods are support, except for those such as Cast<T>(), which require a type argument. We don't have plans to implement support for calling generic methods in the ExpressionEditor, but we will consider making it possible to cast values.
Unfortunately, the only thing I can suggest right now is to add properties or methods on your model class that can expose the DataValue property as a double.
We will release thorough documentation of the expression parser with our Q2 beta release, which should be out in a couple of weeks.
All the best,
Yavor Georgiev
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