Articles in this section
Category / Section

How to hide button in OLAP Client toolbar?

1 min read

To hide the toolbar button in OLAP Client, you need to hide the connection option from the OLAP Client toolbar.

Refer to the following code example to hide the toolbar button in OLAP Client.

C#

protected void Page_Load(object sender, EventArgs e)
{ 
    this.Hidetoolbaritems(this.OlapClient1.OlapClientToolBar.Controls);               
}
private void Hidetoolbaritems(ControlCollection parent Control)
{
   foreach (Control ctrl in parent Control)
   {
      if (ctrl is LinkButton || ctrl is HtmlGenericControl)
      {
          // To hide the connection option in the toolbar.
          if (ctrl.ID == "connectionImg")
             ctrl.Visible = false;
      }
      else
      {
          Hidetoolbaritems (ctrl.Controls);
      }
   }
}

 

VB

Protected  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) 
    Me.Hidetoolbaritems(Me.OlapClient1.OlapClientToolBar.Controls)
End Sub
Private  Sub Hidetoolbaritems(ByVal parent As ControlCollection)
   Dim ctrl As Control
   For Each ctrl In parent Control
      If TypeOf ctrl Is LinkButton Or ctrl Is HtmlGenericControl Then
          ' To hide the connection option in the toolbar.
          If ctrl.ID = "connectionImg" Then
             ctrl.Visible = False
          End If
      Else 
          Hidetoolbaritems (ctrl.Controls)
      End If
   Next
End Sub

 

As an alternate solution, you can also hide the toolbar button using script. Refer to the following code example.

Script

<script type="text/javascript">
    $(document).ready(function () {
       $(".connectionImg").hide();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ClientEndRequest);
    });
    function ClientEndRequest(sender, args) {
        $(".connectionImg ").hide();
    }
</script>

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