I can't seem to find a way to expand all the Hierachy's on load or via code. Is this available? Version 15.1
Hi Jose,
Thank you for posting in our forums.
The data sources have an ExpandExisMemberAsync method which can be used to expand all hierarchies of the grid. To do that you can use the InitializeColumn and InitializeRow events of the PivotGrid and use the following code:
FlatDataSource ds = ultraPivotGrid1.DataSource as FlatDataSource;
// For the InitializeColumn event substitute the e.Row with e.Column
if (e.Row.IsExpandable && e.Row.Expanded == false && ds.IsAsyncOperationPending == false)
{
ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Row, e.Row.TupleIndex, e.Row.MemberIndex, true, this.ultraPivotGrid1);
}
Please let me know if you have any additional questions.
this solution can't expend upper level , it is only can expend lowest level ...
Hi Dimitar,
Using the code you provided works fine for the columns but for the rows it appears to only expand the First / Or Last Row. I have 3 Rows in my Pivot and this is what it does when I excecute the code form InitializeRow
It expanded the Items Grouping / Row but not the Product or Line Type.
This is the code I used.
private void UltraPivotGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinPivotGrid.InitializeRowEventArgs e) { if (e.Row.IsExpandable && e.Row.Expanded == false && ds.IsAsyncOperationPending == false) { ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Row, e.Row.TupleIndex, e.Row.MemberIndex, true, ultraPivotGrid1); } }