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.
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); } }
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.