Page 1 of 1

How to hide buttons on ChartController

Posted: Tue Mar 10, 2015 6:03 am
by 16071129
I m using ChartController for my charts and i wanted to hide some buttons of it e.g. 3D, Zoom.
Help me find out how this can be achieved

Re: How to hide buttons on ChartController

Posted: Tue Mar 10, 2015 9:36 am
by Christopher
Quant,

One way to achieve this which enables you to see what is going on is this:

Code: Select all

      ToolBarButton[] buttons = commander.Buttons;
      List<ToolBarButton> newButtons = new List<ToolBarButton>();
      foreach (ToolBarButton button in buttons)
      {
        if (!((string)button.Tag).Contains("Zoom") && !((string)button.Tag).Contains("3D"))
        {
          newButtons.Add(button);
        }
      }

      commander.Buttons = newButtons.ToArray();