This is a migrated thread and some comments may be shown as answers.

RadPivotFieldList: Calculated Fields and Container Nodes

2 Answers 84 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Gianpaolo
Top achievements
Rank 1
Gianpaolo asked on 26 Jun 2018, 03:38 PM

I have a couple questions regarding the use of RadPivotFieldList with a LocalDataSourceProvider:

1) When I try to add a CalculatedField to the LocalDataSourceProvider at runtime, RadPivotFieldList does not refresh unless I change the ItemsSource (by setting it to null and back to the previous items source). Is there any other way to refresh the list?

2) Is there a way to automatically expand Container Nodes in RadPivotFieldList? I tried using an implicit style targeting TreeGridRowGroupHeader but it is not working.

Thanks,

Gian Paolo

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 29 Jun 2018, 01:45 PM
Hello Gian Paolo,

I will check you requirements and get back to you a bit later today.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Martin Ivanov
Telerik team
answered on 02 Jul 2018, 01:48 PM
Hello Gian Paolo,

Please excuse me for the delay.

About the refresh of the calculated fields, with the current implementation of the pivot grid the calculated fields should be set before the ItemsSource setting. After this they can't be refresh unless you refresh the source as in your case. 

As for expanding the collapsed nodes, doing this via a style doesn't work because the IsExpanded property is set in code which has a higher priority than a style setter. In order to achieve this requirement you can get the TreeGridRowGroupHeader elements in code and set their isExpanded property. Here is an example in code:
private void RadPivotFieldList_Loaded(object sender, RoutedEventArgs e)
{
    var nodes = this.FieldList.ChildrenOfType<TreeGridRowGroupHeader>();
    foreach (var node in nodes)
    {
        node.IsExpanded = true;
    }
}
I hope that helps.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
PivotGrid
Asked by
Gianpaolo
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or