Articles in this section
Category / Section

How to find the checked state of WPF OlapClient members?

1 min read

In WPF OlapClient, 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

 Conclusion

I hope you enjoyed learning how to find the checked state of members inside the member editor.
You can refer to our WPF OlapClient feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF OlapClient example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!
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