Category / Section
Hide the dimensions present in Cube Dimension Browser in WebForms?
1 min read
You can hide the dimensions present in Cube Dimension Browser using the following code example in PreRender event.
C#
void OlapClient1_PreRender(object sender, EventArgs e) { TreeNodeCollection tree = this.OlapClient1.CubeDimensionBrowser.Nodes[0].ChildNodes; for (int i = tree.Count - 1; i >= 0; i--) { if (tree[i].Text != "Customer" || tree[i].Text != "Employee") tree.RemoveAt(i); } }
VB
Private Sub OlapClient1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Dim tree As TreeNodeCollection = Me.OlapClient1.CubeDimensionBrowser.Nodes(0).ChildNodes For i As Integer = tree.Count - 1 To 0 Step -1 If tree(i).Text <> "Customer" OrElse tree(i).Text <> "Employee" Then tree.RemoveAt(i) End If Next i End Sub