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
this solution can't expend upper level , it is only can expend lowest level ...
Hi Jose,
I assume that the reason it isn’t working for you is that the IsAsyncOperationPending properties returns true for some of the rows and that is why they are not expanding. Since the operations are asynchronous it would be difficult to reliably expand every single row. What I suggest in this case is to log a new product idea for this in our product ideas site, since currently it seems that the grid is able to expand only single rows.
Please let me know if you have any additional questions.
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); } }
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);
}
So I found out the function I need to call to make a node expand and I basically hard coded looping through what I need which is SUPER Hacky
(See below)
I'd love to find a way to get all the different nodes TupleIndex and MemberIndex and whether it can be expanded so that my looping isn't hard coded.
ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Column, 0, 0, true, ultraPivotGrid1); while (ds.IsAsyncOperationPending) ; ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Row, 0, 0, true, ultraPivotGrid1); while (ds.IsAsyncOperationPending) ; ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Row, 1, 1, true, ultraPivotGrid1); while (ds.IsAsyncOperationPending) ; ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Row, 2, 1, true, ultraPivotGrid1); while (ds.IsAsyncOperationPending) ; ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Row, 3, 1, true, ultraPivotGrid1); while (ds.IsAsyncOperationPending) ;
for (int i = 4; i < 100; i++) { try { ds.ExpandAxisTupleMemberAsync(Infragistics.Olap.AxisType.Row, i, 2, true, ultraPivotGrid1); while (ds.IsAsyncOperationPending) ; } catch (Exception es) { break; } }