Dear Telerik,
Today we have upgraded to version 'RadControls_for_WPF_2012_1_0326'.
We have encountered a problem after upgrading.
The Aggregate Sumfunction of our RadTreeListView always displays 0 instead of the right sum.
Did something change in the new version ?
Regards,
Gert
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding CalVal,StringFormat=N,ConverterCulture=DE}"
Header
=
"Σ"
Width
=
"Auto"
TextAlignment
=
"Right"
FooterTextAlignment
=
"Right"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"{Binding parentItem, Converter={StaticResource backColorConvertor},ConverterParameter=Summe}"
/>
</
Style
>
</
telerik:GridViewDataColumn.CellStyle
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
SourceField
=
"CalVal"
Caption
=
"Sum: "
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
17 Answers, 1 is accepted

I have the same problem. The Aggregate functions in the RadGridView work fine, but in the RadTreeListView it is always 0.
I tried defining the functions in the code-behind, but that did not help. I tried setting the SourceFieldType but that did not help either.
Can you please check this?
Best Regards,
Henri
Thank you for reporting this issue. We were able to reproduce it on our side and we will do our best to provide a fix as soon as possible.
Excuse us for the inconvenience caused.
Vera
the Telerik team
The issue was resolved and the fix for it will be part of our next Internal Build expected till the end of the day.
Vera
the Telerik team

Thank you :)


I am working with trial version 2012.1.326.1050.
The definition of the datacolumn is:
<telerik:GridViewDataColumn DataMemberBinding="{Binding Data}"
Header="Umsatz"
Background="#10FFFFFF"
TextAlignment="Right"
Width="100"
HeaderTextAlignment="Right">
<telerik:GridViewDataColumn.AggregateFunctions>
<telerik:SumFunction Caption="Sum: " />
</telerik:GridViewDataColumn.AggregateFunctions>
</telerik:GridViewDataColumn>
and I get an error with the following stacktrace:
Telerik.Windows.Data.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.ConvertMemberAccessExpressionIfNecessary(Expression memberExpression)
bei Telerik.Windows.Data.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateMemberSelectorExpression()
bei Telerik.Windows.Data.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateAggregateExpression()
bei Telerik.Windows.Data.EnumerableSelectorAggregateFunction.CreateAggregateExpression(Expression enumerableExpression)
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.<ProjectionPropertyValueExpressions>b__3(AggregateFunction f)
bei System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
bei System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression()
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding()
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.<CreateMemberBindings>d__0.MoveNext()
bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
bei System.Dynamic.Utils.CollectionExtensions.ToReadOnly[T](IEnumerable`1 enumerable)
bei System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression()
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateResultSelectorExpression()
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.get_ResultSelectorExpression()
bei Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery()
bei Telerik.Windows.Data.Expressions.GroupDescriptorCollectionExpressionBuilder.CreateChildQuery(GroupDescriptorExpressionBuilder childBuilder)
bei Telerik.Windows.Data.Expressions.GroupDescriptorCollectionExpressionBuilder.CreateQuery()
bei Telerik.Windows.Data.QueryableExtensions.GroupBy(IQueryable source, IEnumerable`1 groupDescriptors)
bei Telerik.Windows.Data.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions)
bei Telerik.Windows.Controls.GridView.GridViewDataControl.CreateAggregateResults()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.CalculateAggregates()
bei Telerik.Windows.Controls.GridViewColumnCollectionInternal.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
bei Telerik.Windows.Controls.GridViewColumnCollectionInternal.InsertItem(Int32 index, GridViewColumn item)
bei System.Collections.ObjectModel.Collection`1.Add(T item)
bei System.Collections.ObjectModel.Collection`1.System.Collections.IList.Add(Object value)
bei MS.Internal.XamlManagedRuntimeRPInvokes.Add(XamlQualifiedObject& qoCollection, XamlPropertyToken inCollectionProperty, XamlQualifiedObject& inValue)
For the "CountFunction" all works fine and in the previous version 2011.3.1220.1040 i have had no problems.
I want to use the DataBar in the treelistview control, so i have to change the version.
Is it possible to get the version 2012.1.402.40 for trials ?
Thanks
Gisela

Thanks
Unfortunately, we were not able to reproduce the issue. May I ask you to open a support ticket and to send a simple runnable project demonstrating the problem?
Thank you in advance.
Vera
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

<
radGrid:RadTreeListView
ItemsSource
=
"{Binding ...}"
>
<
radGrid:RadTreeListView.ChildTableDefinitions
>
<
radGrid:TreeListViewTableDefinition
ItemsSource
=
"{Binding ....}"
>
</
radGrid:TreeListViewTableDefinition
>
</
radGrid:RadTreeListView.ChildTableDefinitions
>
<
radGrid:RadTreeListView.Columns
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Amount"
DataMemberBinding
=
"{Binding Amount}"
DataFormatString
=
"{}{0:c}"
>
<
radGrid:GridViewDataColumn.AggregateFunctions
>
<
teldata:SumFunction
Caption
=
""
ResultFormatString
=
"{}{0:c}"
SourceField
=
"Amount"
/>
</
radGrid:GridViewDataColumn.AggregateFunctions
>
</
radGrid:GridViewDataColumn
>
</
radGrid:RadTreeListView.Columns
>
</
radGrid:RadTreeListView
>
We found a problem with the format string of the aggregate function result. The currency sign in the footer is different than the one in the column. May I ask you to clarify if this is the exact problem you experience? What is your current culture?
Vera
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Thanks for the quick response.
I do not have a culture specified. App is in-house and is under en-US only and not meant to support anything else. There have been no code changes, also this is the only instance of RadTreeListView in the application.
Previous RadControls version was 2012.1.215.40. Which I upgraded yesterday to the new dlls and this stopped working. RadGrid total rows are unaffected.
The exact problem is that the footer shows $0.00 as total. Do you want me to specify culture specifically for the tree list?
Thanks,
Erol
The issue you experience was fixed a long time ago. May I ask you to take a look at the attached project? Are you able to get the problem on it?
Vera
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Thanks for your project, it helped realize the difference.
My inner list is not the same as outer. It is not a self referencing structure and it is a 2 level structure only. Somehow the new sum function expects the child element to be of the same type as the parent element.
I have modified the project you provided with my changes to replicate the issue as below,
public class WarehouseItemInner
{
public WarehouseItemInner()
{
}
public WarehouseItemInner(string name, decimal count, DateTime date, bool isExpanded)
{
this.Name = name;
this.Count = count;
this.Date = date;
this.IsExpanded = isExpanded;
}
public bool IsExpanded
{
get;
set;
}
public string Name
{
get;
set;
}
public decimal Count
{
get;
set;
}
public DateTime Date
{
get;
set;
}
public override string ToString()
{
return this.Name;
}
}
public static ObservableCollection<
WarehouseItem
> GetWarehouseData()
{
ObservableCollection<
WarehouseItem
> data = new ObservableCollection<
WarehouseItem
>();
WarehouseItem drinks = new WarehouseItem("_Drinks", 1, new DateTime(2011, 12, 1), true);
drinks.Items.Add(new WarehouseItemInner("Water", 20.2M, new DateTime(2011, 12, 2), false));
data.Add(drinks);
WarehouseItem vegetables = new WarehouseItem("Vegetables", 40, new DateTime(2011, 12, 9), true);
vegetables.Items.Add(new WarehouseItemInner("Tomato", 50, new DateTime(2011, 12, 10), false));
vegetables.Items.Add(new WarehouseItemInner("Carrot", 50, new DateTime(2011, 12, 11), false));
vegetables.Items.Add(new WarehouseItemInner("Onion", 50, new DateTime(2011, 12, 12), false));
data.Add(vegetables);
WarehouseItem fruits = new WarehouseItem("Fruits", 50, new DateTime(2011, 12, 13), true);
fruits.Items.Add(new WarehouseItemInner("Cherry", 60, new DateTime(2011, 12, 14), false));
fruits.Items.Add(new WarehouseItemInner("Apple ", 60, new DateTime(2011, 12, 15), false));
fruits.Items.Add(new WarehouseItemInner("Melon", 60, new DateTime(2011, 12, 16), false));
data.Add(fruits);
return data;
}
Let me know if this can be handled directly or if it is possible for me to just override the data in footer to show a pre-calculated number.
Thanks,
Erol
Unfortunately, your scenario is not supported. What you can do in order to achieve the desired result is to use a custom aggregate function. You can take a look at this demo as well. Those are Silverlight demos but you can find them in your WPF local copy.
I hope this helps.
Vera
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Thanks a lot. Will do Custom Aggregates. BTW another upgrade related issue, this time RichTextBox raised here http://www.telerik.com/community/forums/wpf/richtextbox/html-export-of-td-with-colspan-has-wrong-width.aspx#2372219
Thanks,
Erol

When I use SumFunction in TreeListView,it always get 0.but it's right in GridView.
Does your collection contain homogeneous data? Please keep in mind that TreeListView is designed to work with homogeneous data.
Regards,
Yoan
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>