We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ISummaryAggregate

Thread ID:

Created:

Updated:

Platform:

Replies:

147822 Sep 25,2019 06:35 AM UTC Sep 25,2019 01:37 PM UTC Xamarin.Forms 1
loading
Tags: SfDataGrid
Tomas Turek
Asked On September 25, 2019 06:35 AM UTC

Hi,

I use CustomAggregate  for customization group header text. Until DataGrid component version 17.2.0.46 is everything OK but in higher versions (including actual 17.3.0.9 beta) I´ve got this error:

CS0738 PageAlarms.CustomAggregate does not implement an ISummaryAggregate.CalculateAggregateFunc(). PageAlarms.CustomAggregate.CalculateAggregateFunc() cannot implement the ISummaryAggregate.CalculateAggregateFunc(), member because it does not have the corresponding return type  Action<IEnumerable, string, PropertyDescriptor>.

//My code:

        public class CustomAggregate : ISummaryAggregate 
        {
            public CustomAggregate()
            {
            }
            public string Date { get; set; }
            public Action<System.Collections.IEnumerable, string, PropertyInfo> CalculateAggregateFunc()
            {
                return (items, property, pd) =>
                {
                    var enumerableItems = items as IEnumerable<PageAlarmsModel>;
                    if (pd.Name == "Date")
                    {
                        var value = (enumerableItems.First() as PageAlarmsModel).Date;
                        var count = enumerableItems.Count().ToString();
                        this.Date = value.Day + "." + value.Month + "." + value.Year + " - " + "Count: " + count;
                    }
                };
            }
      }


//Interface:

    public interface ISummaryAggregate
    {
        // Summary:
        //     Calculates the custom aggregate func for the specified summary column.
        //
        // Return:
        //     The custom aggregate func for the specified summary column.
        Action<IEnumerable, string, PropertyDescriptor> CalculateAggregateFunc();
    }

Balasubramani Sundaram [Syncfusion]
Replied On September 25, 2019 01:37 PM UTC

Hi Tomas,  
 
Thank you for contacting Syncfusion support.   
  
It’s already a known issue because we had changed the “Propertyinfo” to "PropertyDescriptor" in summary aggregated due to the reason of upgrading the source to .Net Standard and we have already mentioned about this breaking change in our release note and well we have to change the UG code snippet.  
 
Please refer the below sample, UG and code snippet, 
 
Code snippet [C#] 
public class CustomeAggreate : ISummaryAggregate 
{ 
    public Action<IEnumerable, string, PropertyDescriptor> CalculateAggregateFunc() 
    { 
 
    } 
} 
  
 
 
 
 
We hope this helps. Please let us know, if you need any further assistance. 
 
Regards,
Balasubramani Sundaram.
 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon