Articles in this section
Category / Section

How to find the default hierarchy of a OlapChart Dimension in Silverlight?

1 min read

You can find the default hierarchy’s unique name present in the dimension by using the following code example.

For illustration, a button is created. On clicking it, the cube schema is processed and gets the default hierarchy’s unique name for the specified dimension.


private void btn_FindDefaultHierarchy_Click(object sender, System.Windows.RoutedEventArgs e)
        string defaultHerarchyName = "";
         var Dimensions = this.olapClient.OlapDataManager.CurrentCubeSchema.Dimensions;
         for (int i = 0; i < Dimensions.Count; i++)
             if (Dimensions[i].Name == "Enter a valid dimension name")
                 defaultHerarchyName = Dimensions[i].DefaultHierarchyName;


Private Sub btn_FindDefaultHierarchy_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
       Dim defaultHerarchyName As String = ""
       Dim Dimensions As var = Me.olapClient.OlapDataManager.CurrentCubeSchema.Dimensions
       Dim i As Integer For i = 0 To Dimensions.Count - 1 Step i + 1
               If Dimensions(i).Name = "Enter a valid dimension name" Then
                     defaultHerarchyName = Dimensions(i).DefaultHierarchyName
                     Exit For
                End If
End Sub

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