This question is locked. New answers and comments are not allowed.
The following code has been working for well over a year since it was put into our code until we upgraded to 2010 Q3 controls.
Now it it wont compile saying AggregateFunctions is an unknown member. I looked at the posted Known Issues and Breaking Changes - RadGridView and it doesn't go into any detail about this being removed. It just has mention of these two changes:
When I look at the IGroupDiscriptor it of course doesn't have this member. Why the heck would you make this kind of breaking functionality without providing resolution on how to get the now missing members? The code I am using was provided by Telerik Support for how to add group counts when a user groups by any column. So I went to look at your Changes and Backward Compatibility page to see if you provided a new functionality to provide this grouping count another way but nothing.
Please advise where the AggregateFunctions collection went and how to add this same type of group count on any grouping a user does. The only examples you have in your documentation is how to do it for a specific (programmatically) grouped column. These are not helpful as they only show how to pre-group a column and how to add the count only to this grouped column. And this documentation confuses the issue more because they show the collection I want on the GroupDescriptor object, it just isn't on the interface any more.
So after all that searching I tried the bellow change and it doesn't work. Because the GroupDescriptor is now a ColumnGroupDescriptor which doesn't have the AggregateFunctions collection.
We are not happy aboutTelerik making this breaking change without proving new solutions to solve what they broke.
private
void
RadWindow_Opened(
object
sender, RoutedEventArgs e)
{
detailGridView.Grouping +=
new
EventHandler<GridViewGroupingEventArgs>(detailGridView_Grouping);
}
private
void
detailGridView_Grouping(
object
sender, GridViewGroupingEventArgs e)
{
if
(e.GroupDescriptor !=
null
&& e.GroupDescriptor.AggregateFunctions.Count == 0
&& detailGridView.GroupDescriptors.Count == 0)
{
try
{
e.GroupDescriptor.AggregateFunctions.Add(
new
CountFunction() { ResultFormatString =
"({0})"
});
}
catch
(Exception ex)
{
MessageBox.Show(ex.Message,
"Error"
, MessageBoxButton.OK);
}
}
}
}
Now it it wont compile saying AggregateFunctions is an unknown member. I looked at the posted Known Issues and Breaking Changes - RadGridView and it doesn't go into any detail about this being removed. It just has mention of these two changes:
- The GroupDescriptor property of GridViewGroupedEventArgs and GridViewGroupingEventArgs is now of type IGroupDescriptor.
- The Action property of the GridViewGroupedEventArgs and GridViewGroupingEventArgs is now of type GroupingEventAction instead of CollectionChangeAction.
- The GroupDescriptors property of RadGridView is now a collection of IGroupDescriptor, instead of GroupDescriptor.
When I look at the IGroupDiscriptor it of course doesn't have this member. Why the heck would you make this kind of breaking functionality without providing resolution on how to get the now missing members? The code I am using was provided by Telerik Support for how to add group counts when a user groups by any column. So I went to look at your Changes and Backward Compatibility page to see if you provided a new functionality to provide this grouping count another way but nothing.
Please advise where the AggregateFunctions collection went and how to add this same type of group count on any grouping a user does. The only examples you have in your documentation is how to do it for a specific (programmatically) grouped column. These are not helpful as they only show how to pre-group a column and how to add the count only to this grouped column. And this documentation confuses the issue more because they show the collection I want on the GroupDescriptor object, it just isn't on the interface any more.
So after all that searching I tried the bellow change and it doesn't work. Because the GroupDescriptor is now a ColumnGroupDescriptor which doesn't have the AggregateFunctions collection.
private
void
detailGridView_Grouping(
object
sender, GridViewGroupingEventArgs e)
{
Telerik.Windows.Data.GroupDescriptor gd = e.GroupDescriptor
as
Telerik.Windows.Data.GroupDescriptor;
if
(gd !=
null
&& gd.AggregateFunctions.Count == 0
&& detailGridView.GroupDescriptors.Count == 0)
{
try
{
gd.AggregateFunctions.Add(
new
CountFunction() { ResultFormatString =
"({0})"
});
}
catch
(Exception ex)
{
MessageBox.Show(ex.Message,
"Error"
, MessageBoxButton.OK);
}
}
}
We are not happy aboutTelerik making this breaking change without proving new solutions to solve what they broke.