Last Updated:
22 Feb 2019 20:30
by ADMIN
PivotGrid: ArgumentOutOfRangeException thrown when row groups are collapsed and the RowSubTotalsPosition is None
Setting the Expanded property of the GroupsExpandBehavior assigned to the RowGroupsExpandBehavior property of RadPivotGrid to True, and the RowSubTotalsPosition to None, leads to an error.
To work this around set the RowSubTotalsPosition to Top.
Or set the IsExpanded property of the corresponding PivotGroupHeader controls manually.
public MainWindow()
{
InitializeComponent();
// the Opacity is used to avoid the flicker that appears because the groups are rendered just before the collapse logic kicks-in.
this.pivotGrid.Opacity = 0;
this.pivotGrid.Loaded += PivotGrid_Loaded;
}
private void PivotGrid_Loaded(object sender, RoutedEventArgs e)
{
Dispatcher.BeginInvoke(new Action(() => {
var headers = this.pivotGrid.ChildrenOfType<PivotGroupHeader>();
foreach (var header in headers)
{
header.IsExpanded = false;
}
this.pivotGrid.Opacity = 1;
}), (DispatcherPriority)3);
}