AggregateFunctions SumFunction not working in Version 2012_1_0326

18 posts, 0 answers
  1. Gert
    Gert avatar
    2 posts
    Member since:
    Mar 2012

    Posted 28 Mar 2012 Link to this post

    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>
  2. Henri
    Henri avatar
    74 posts
    Member since:
    Aug 2008

    Posted 29 Mar 2012 Link to this post

    Hi,

    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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Vera
    Admin
    Vera avatar
    263 posts

    Posted 29 Mar 2012 Link to this post

    Hi,

     
    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.

    Greetings,
    Vera
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Vera
    Admin
    Vera avatar
    263 posts

    Posted 02 Apr 2012 Link to this post

    Hi,

     
    The issue was resolved and the fix for it will be part of our next Internal Build expected till the end of the day.

    Greetings,
    Vera
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Henri
    Henri avatar
    74 posts
    Member since:
    Aug 2008

    Posted 03 Apr 2012 Link to this post

    The SumFunction is working again in version 2012.1.402.40.
    Thank you :)
  7. Gert
    Gert avatar
    2 posts
    Member since:
    Mar 2012

    Posted 03 Apr 2012 Link to this post

    Ok, thx !
  8. gisela
    gisela avatar
    15 posts
    Member since:
    Feb 2006

    Posted 16 Apr 2012 Link to this post

    Hi All,

    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




  9. gisela
    gisela avatar
    15 posts
    Member since:
    Feb 2006

    Posted 16 Apr 2012 Link to this post

    Sorry, i have forgotton to say, that i am working with Silverlight.

    Thanks
  10. Vera
    Admin
    Vera avatar
    263 posts

    Posted 16 Apr 2012 Link to this post

    Hi Gisela,

     
    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.

    All the best,
    Vera
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  11. Erol
    Erol avatar
    6 posts
    Member since:
    Feb 2012

    Posted 05 Nov 2012 Link to this post

    Just started getting this problem. Updated today to RadControls for WPF Q3 2012 (2012.3.1017.40).
    <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>
  12. Vera
    Admin
    Vera avatar
    263 posts

    Posted 06 Nov 2012 Link to this post

    Hi Erol,

     
    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?

    Greetings,
    Vera
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  13. Erol
    Erol avatar
    6 posts
    Member since:
    Feb 2012

    Posted 06 Nov 2012 Link to this post

    Vera,

    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
  14. Vera
    Admin
    Vera avatar
    263 posts

    Posted 06 Nov 2012 Link to this post

    Hello 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? 

    Greetings,
    Vera
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  15. Erol
    Erol avatar
    6 posts
    Member since:
    Feb 2012

    Posted 12 Nov 2012 Link to this post

    Vera,

    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
  16. Vera
    Admin
    Vera avatar
    263 posts

    Posted 13 Nov 2012 Link to this post

    Hi 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.

    Regards,
    Vera
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  17. Erol
    Erol avatar
    6 posts
    Member since:
    Feb 2012

    Posted 13 Nov 2012 Link to this post

    Vera,

    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
  18. Eddy
    Eddy avatar
    2 posts
    Member since:
    Aug 2013

    Posted 17 Oct 2013 Link to this post

    Why does't it work in Version 2013_2_0724?

    When I use SumFunction in TreeListView,it always get 0.but it's right in GridView.
  19. Yoan
    Admin
    Yoan avatar
    1068 posts

    Posted 22 Oct 2013 Link to this post

    Hello Li,

    Does your collection contain homogeneous data? Please keep in mind that TreeListView is designed to work with homogeneous data. 


    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready