How to check the presence of measure in column and row axes?
In WPF OlapClient, you can check the presence of measure in row or column axes by using OlapClient_Loaded event. Refer to the following code example.
C#
public MainWindow() { ViewModel.ViewModel.ConnectionString=this.GetConnectionString(); this.olapClient1.Loaded += olapClient1_Loaded; } void olapClient1_Loaded(object sender, RoutedEventArgs e) { if(this.olapClient1!=null && this.olapClient1.OlapDataManager != null) { for (int i = 0; i < this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes.Count; i++) { if (this.olapClient1.AxisElementBuilderColumn.MetaTreeNodes[i].Name == "Measures") isInColumn = true; else if (this.olapClient1.AxisElementBuilderRow.MetaTreeNodes[i].Name == "Measures") isInRow = true; } } }
VB
Public Sub New() ViewModel.ViewModel.ConnectionString=Me.GetConnectionString() AddHandler Me.olapClient1.Loaded, AddressOf olapClient1_Loaded End Sub Private Sub olapClient1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) If Me.olapClient1 IsNot Nothing AndAlso Me.olapClient1.OlapDataManager IsNot Nothing Then For i As Integer = 0 To Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes.Count - 1 If Me.olapClient1.AxisElementBuilderColumn.MetaTreeNodes(i).Name = "Measures" Then isInColumn = True ElseIf Me.olapClient1.AxisElementBuilderRow.MetaTreeNodes(i).Name = "Measures" Then isInRow = True End If Next i End If End Sub
Conclusion
I hope you enjoyed learning about how to check the presence of measure in column and row axes in WPF OlapClient.
You can refer to our WPF OlapClient Control featuretour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.
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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!