Category / Section
How to find the checked state of members inside the member editor?
1 min read
You can find the checked state of members by using the following code example.
C#
public MainWindow() { InitializeComponent(); this.olapClient1.OlapDataManager = new Syncfusion.Olap.Manager.OlapDataManager("Data Source=http://bi.syncfusion.com/olap/msmdpump.dll; Initial Catalog=Adventure Works DW 2008 SE;"); this.olapClient1.OlapDataManager.SetCurrentReport(SampleReport()); this.olapClient1.Loaded += olapClient1_Loaded; } void olapClient1_Loaded(object sender, System.Windows.RoutedEventArgs e) { List<string> childNodeCollection = new List<string>(); string metaTreeNodeIsSelected= ""; string childNodeIsSelected = ""; if(this.olapClient1.AxisElementBuilderColumn!=null) { for(int i=0;i<this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes.Count;i++) { if (this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes[i].NodeType.ToString() != "MeasureGroup") { metaTreeNodeIsSelected = this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes[i].IsSelected.ToString(); for(int j=0;j<this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes[i].ChildNodes.Count;j++) { if (this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes[i].ChildNodes[j].IsSelected == true) { childNodeIsSelected =this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes[i].ChildNodes[j].Caption.ToString(); childNodeCollection.Add(childNodeIsSelected); } } } } } }
VB
Public Sub New() InitializeComponent() Me.olapClient1.OlapDataManager = New Syncfusion.Olap.Manager.OlapDataManager("Data Source=http://bi.syncfusion.com/olap/msmdpump.dll; Initial Catalog=Adventure Works DW 2008 SE;") Me.olapClient1.OlapDataManager.SetCurrentReport(SampleReport()) AddHandler Me.olapClient1.Loaded, AddressOf olapClient1_Loaded End Sub Private Sub olapClient1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Dim childNodeCollection As New List(Of String)() Dim metaTreeNodeIsSelected As String= "" Dim childNodeIsSelected As String = "" If Me.olapClient1.AxisElementBuilderColumn IsNot Nothing Then For i As Integer = 0 To Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes.Count - 1 If Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes(i).NodeType.ToString() <> "MeasureGroup" Then metaTreeNodeIsSelected = Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes(i).IsSelected.ToString() For j As Integer = 0 To Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes(i).ChildNodes.Count - 1 If Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes(i).ChildNodes(j).IsSelected = True Then childNodeIsSelected =Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes(i).ChildNodes(j).Caption.ToString() childNodeCollection.Add(childNodeIsSelected) End If Next j End If Next i End If End Sub