With the current implementation the top level header only visually appears as one cell, however it stretches the subheader column below (check PivotGrid(Now).png). Looking the attach file,now the XAML is following: <pivot:LocalDataSourceProvider.AggregateDescriptions> <pivot:PropertyAggregateDescription PropertyName="AccValue" CustomName="total"/> <pivot:PropertyAggregateDescription PropertyName="IncValue" CustomName="increased"/> </pivot:LocalDataSourceProvider.AggregateDescriptions> <pivot:LocalDataSourceProvider.ColumnGroupDescriptions> <pivot:PropertyGroupDescription PropertyName="SystemDeviceCode"/> </pivot:LocalDataSourceProvider.ColumnGroupDescriptions> the SystemDeviceCode column just use one column ,like the attach "PivotGrid(Now).png",when the text is long ,the first column "Total" is too wide . I hope like the attach "PivotGrid(desired).PNG",the SystemDeviceCode column can span two columns. and the data struct: public class DayStruct1 { public string HourNum { get; set; } public string SystemDeviceCode { get; set; } public double AccValue { get; set; } public double IncValue { get; set; } public DateTime Date { get; set; } }//
I want to create CustomDistinct aggregate, I did it successfully for LocalDataSourceProvider, and I need it also for QueryableDataProvider. See: http://www.telerik.com/forums/custom-aggregate-for-queryabledataprovider
Currently when a header value is empty the displayed text is "(blank)" regardless of the application's culture. Localize this value or allow the developer to set this value more easily. If you want to manually localize the "(blank)" text you can define a RowHeaderTemplate and ColumnHeaderTemplate (or template selector) and replace the default text with its translation. You can do that via IValueConverter. (http://docs.telerik.com/devtools/wpf/controls/radpivotgrid/styles-and-templates/templating-cells#using-custom-cell-and-header-templates)
I implemented it for me, but I will be glad to get it out of the box for all providers. public class ExtendableLocalDataSourceFieldDescriptionsProvider : LocalDataSourceFieldDescriptionsProvider { protected override ContainerNode GetFieldDescriptionHierarchy(IEnumerable<IPivotFieldInfo> fieldInfos) { var root = base.GetFieldDescriptionHierarchy(fieldInfos); var childs = from node in root.Children let info = node.GetFieldInfoNode() let dispAtt = info.FieldInfo.GetDisplayAttribute() let groupName = dispAtt.GetGroupName() where !string.IsNullOrEmpty(groupName) group node by groupName into g select new { g.Key, g }; foreach (var group in childs.Reverse()) { var newFolder = new ContainerNode(group.Key, ContainerNodeRole.Folder); foreach (var item in group.g) { root.Children.Remove(item); newFolder.Children.Add(item); } } return root; } Note: GetFieldInfoNode & GetDisplayAttribute are extension methods.
The implemented is very easily: public class ExtendableLocalDataSourceFieldDescriptionsProvider : LocalDataSourceFieldDescriptionsProvider { protected override ContainerNode GetFieldDescriptionHierarchy(IEnumerable<IPivotFieldInfo> fieldInfos) { var infos = from info in fieldInfos orderby info.GetDisplayAttribute()?.GetOrder() select info; return base.GetFieldDescriptionHierarchy(fieldInfos); } We will be glad to get it out of the box for all data providers.
When I use QueryableDataProvider, the DisplayName of the aggregates is "Sum of MyField" etc., instead of the value of 'Pivot_AggregateSum' localization key.
I have Written behavior to auto-format the AggregateDescription.StringFormat. Now, I need to list all possible AggregateDescription's, with reference to their DLL. if (e.Description is LocalAggregateDescription) { (e.Description as LocalAggregateDescription).StringFormat = MyStringFormat; } else if (e.Description is QueryableAggregateDescription) { (e.Description as QueryableAggregateDescription).StringFormat = MyStringFormat; } else if (e.Description is Other_XYZ_AggregateDescription) { (e.Description as Other_XYZ_AggregateDescription).StringFormat = MyStringFormat; } But, if IStringFormattableAggregate was public, I would can write it better: if (e.Description is IStringFormattableAggregate) { (e.Description as IStringFormattableAggregate).StringFormat = MyStringFormat; }
As you did with PropertyInfoFieldInfo, which expose PropertyInfo property. This can be very helpful to many custom logic based on the source PropertyInfo. For example: private static DisplayAttribute GetDisplayAttribute(QueryableFieldDescription fieldInfo) { return fieldInfo.PropertyInfo.GetCustomAttribute<DisplayAttribute>(); }
Available in the 2017 R1 Release (2017.1.117).
Implement functionality to show a break down of items that aggreagate to current cell. Available in the 2017 R1 Release (2017.1.117). For more reference you can check the following help article: http://docs.telerik.com/devtools/wpf/controls/radpivotgrid/features/localdatasourceprovider/drilldown
Add options for showing items with no data as in Local data provider.
When a filter dialog is shown (Report Filter or Label Filter) for OLAP Hierarchy, it contains the items only for the selected level. Instead items from all levels could be visible, so you won't have to open additional dialogs to filter them (show them like a tree).