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();
}