This question is locked. New answers and comments are not allowed.
What happened to the AggregateFunctions property on GroupDescriptor?
This code doesn't compile anymore ager 2010 Q1 update:
This code doesn't compile anymore ager 2010 Q1 update:
| private IEnumerable<AggregateFunction> GetFunctionByName(string functionName) |
| { |
| var functions = |
| from descriptor in Grid.GroupDescriptors |
| from function in descriptor.AggregateFunctions |
| where function.FunctionName == functionName |
| select function; |
| return functions; |
| } |
5 Answers, 1 is accepted
0
Accepted
Hello Jax,
Here is an example how to do the same for Q1 2010:
private IEnumerable<AggregateFunction> GetFunctionByName(string functionName)
{
var functions =
from descriptor in Grid.GroupDescriptors.OfType<GroupDescriptor>()
from function in descriptor.AggregateFunctions
where function.FunctionName == functionName
select function;
return functions;
}
Regards,
Vlad
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.
Here is an example how to do the same for Q1 2010:
private IEnumerable<AggregateFunction> GetFunctionByName(string functionName)
{
var functions =
from descriptor in Grid.GroupDescriptors.OfType<GroupDescriptor>()
from function in descriptor.AggregateFunctions
where function.FunctionName == functionName
select function;
return functions;
}
Regards,
Vlad
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
Jax
Top achievements
Rank 2
answered on 17 Mar 2010, 08:06 AM
Is there a reason that AggregateFunctions property is not exposed on the IGroupDescriptor interface?
- now I have to explicitly cast every time I need access to the property.
- now I have to explicitly cast every time I need access to the property.
0
Hi Jax,
AggregateFunctions are now exposed through IAggregateFunctionsProvider interface. We have done this change in order to facility new features we are going to implement in the future. My suggestion for you is to create simple extension method that can ease your work:
Actually we have this extension method in our code base and we can expose it as public in the future.
Regards,
Stefan Dobrev
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.
AggregateFunctions are now exposed through IAggregateFunctionsProvider interface. We have done this change in order to facility new features we are going to implement in the future. My suggestion for you is to create simple extension method that can ease your work:
internal static class GroupDescriptorExtensions{ public static IEnumerable<AggregateFunction> GetAggregateFunctions(this IGroupDescriptor groupDescriptor) { var aggregateFunctionsProvider = groupDescriptor as IAggregateFunctionsProvider; if (aggregateFunctionsProvider != null) { return aggregateFunctionsProvider.AggregateFunctions; } return Enumerable.Empty<AggregateFunction>(); }}Regards,
Stefan Dobrev
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
Jax
Top achievements
Rank 2
answered on 17 Mar 2010, 01:24 PM
I'm still not convinced as to the justification for the change.
According to the API of IGroupDescriptor, it is now not explicit that I can get access to the AggregateFunctions property.
As a user, I now have to have pre-existing knowledge that I must cast the IGroupDescriptor (or write extension methods), in order to get access to the AggregateFunctions property.
How will new users of the control library know they need to do this to get access to the AggregateFunctions property?
Why not expose it on the IGroupDescriptor interface?
According to the API of IGroupDescriptor, it is now not explicit that I can get access to the AggregateFunctions property.
As a user, I now have to have pre-existing knowledge that I must cast the IGroupDescriptor (or write extension methods), in order to get access to the AggregateFunctions property.
How will new users of the control library know they need to do this to get access to the AggregateFunctions property?
Why not expose it on the IGroupDescriptor interface?
0
Hello Jax,
We don't expose it on the IGroupDescriptor interface, because there may be group descriptors' implementation which cannot perform aggregations and it will be confusing to have a property AggregateFunctions on the IGroupDescriptor interface and not have aggregate results displayed back. If you have looked at RIA Services' GroupDescriptor or GroupDescription class that can be found in the framework they do not have the notion of the aggregation. In order to represent all these brought scenarios we have split the grouping into two interfaces IGroupDescriptor and IAggregateFunctionsProvider and our GroupDescriptor class implements them both.
All the best,
Stefan Dobrev
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.
We don't expose it on the IGroupDescriptor interface, because there may be group descriptors' implementation which cannot perform aggregations and it will be confusing to have a property AggregateFunctions on the IGroupDescriptor interface and not have aggregate results displayed back. If you have looked at RIA Services' GroupDescriptor or GroupDescription class that can be found in the framework they do not have the notion of the aggregation. In order to represent all these brought scenarios we have split the grouping into two interfaces IGroupDescriptor and IAggregateFunctionsProvider and our GroupDescriptor class implements them both.
All the best,
Stefan Dobrev
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.
