I am using a Count AggregateFunction and I would like to access it's value from the code behind. This task can be managed using the function getaggregateresults(QueryableCollectionViewGroup group) but I am having problems accessing the QueryableCollectionViewGroup object, because it's constructor is protected.
Here's the code that I am using:
<GridViewDataColumn UniqueName="NameHeader">
<telerik:GridViewDataColumn.AggregateFunctions>
<telerik:CountFunction Caption="Count: " />
</telerik:GridViewDataColumn.AggregateFunctions>
</GridViewDataColumn>`
The function call would be laike this:
this.RadTreeListView.Columns["NameHeader"].GetAggregateResults(QUERYABLEGROUP).ElementAt(0).FormattedValue;
I would appreciate any help.
Thanks in advance.
I have managed to retrieve the answer executing this function when the RadTreeListView.DataLoaded event occurs:
The
RadTreeListViewonly has the Count aggregate function, so it always be at index 0. The result is wrapped on theAggregateResult. This code is an example, however it lights the path to a solution.I hope this answer will be able to help if anyone has the same problem.