Articles in this section
Category / Section

How to expand all the members of a hierarchy in WPF OlapChart ?

1 min read

You can expand all the members of a hierarchy by setting the DrillState property of DimensionElement to ExpandAll as follows.

For example, a button has been created and in its click event, the dimension at the row, at first index, has been completely expanded and the control is refreshed.

C#

public MainWindow()
        {
                InitializeComponent();
                this.olapGrid1.OlapDataManager = new       
                Syncfusion.Olap.Manager.OlapDataManager("Data 
                Source=http://bi.syncfusion.com/olap/msmdpump.dll;
                Initial Catalog=Adventure Works DW 2008 SE;");
                this.olapGrid1.OlapDataManager.SetCurrentReport(SampleReport());
        }
private void btn_ExpandAll_Click(object sender, System.Windows.RoutedEventArgs e)
        {                (this.olapGrid1.OlapDataManager.CurrentReport.SeriesElements[1].ElementValue as DimensionElement).DrillState = DrillState.ExpandAll;
                 this.olapGrid1.DataBind();
        }

VB

Public Sub New()
                InitializeComponent()
                Me.olapGrid1.OlapDataManager = New    
            Syncfusion.Olap.Manager.OlapDataManager("Data 
            Source=http://bi.syncfusion.com/olap/msmdpump.dll; Initial Catalog=Adventure   
            Works DW 2008 SE;")                                                Me.olapGrid1.OlapDataManager.SetCurrentReport(SampleReport())
End Sub
Private Sub btn_ExpandAll_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
                TryCast(Me.olapGrid1.OlapDataManager.CurrentReport.SeriesElements(1).
            ElementValue, DimensionElement).DrillState = DrillState.ExpandAll
                Me.olapGrid1.DataBind()
End Sub

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied