OLAP Grid: toggle features

Posted by: abellisomi on 24 March 2020, 7:45 am EST

  • Posted 24 March 2020, 7:45 am EST

    Hello,
    I would like to simplify a bit the aspect of the OlapPage component; Is it possible to hide the Save/Load button and the Chart section?

    Thanks
  • Marked as Answer

    Replied 24 March 2020, 7:17 pm EST

    Hi,

    C1Olap has all the buttons present inside the MainMenu's Items collection. So, if you want to hide any of them then just access the Items in the MainMenu and set its Visibility to Collapsed

    To hide Load button:
    var loadButton = _c1OlapPage.MainMenu.Items[0] as C1MenuItem;
    if (loadButton != null)
    loadButton.Visibility = Visibility.Collapsed;
    To save Load button:
    var saveButton = _c1OlapPage.MainMenu.Items[1] as C1MenuItem;
    if (saveButton != null)
    saveButton.Visibility = Visibility.Collapsed;
    Similarly, the grid/chart/rawgrid are present inside the TabControl as TabPages. So, to hide the Chart section, through VisualTreeHelper access the TabControl and see the Visibility of its second item to Collapsed.
    var tab = FindChild<TabControl>(_c1OlapPage, "Tab") as TabControl;
    if (tab != null)
    {
    var chart = tab.Items[1] as TabItem;
    chart.Visibility = Visibility.Collapsed;
    }
    See attached application for complete code.
    With regards,
    Ruchir
    CustomizeOlap_Demo.zip
  • Replied 25 March 2020, 11:45 am EST

    Ok, I see how that would work. Thank you Ruchir
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels