We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the Tooltip of the Cube Dimension Browser

Platform: Silverlight |
Control: OlapClient |
Published Date: November 21, 2014 |
Last Revised Date: November 25, 2014

We can customize the tooltip of the Cube dimension browser by hooking up the MouseOver event of the CubeDimensionBrowser. We have provided the option to customize the tooltip text of cube dimension browser and this can be achieved by following code snippet.

C#

public MainPage()

        {

            InitializeComponent();

            this.DataContext = new ViewModel.ViewModel();

            this.olapClient.Loaded += (send, e) =>

            {

                this.olapClient.CubeDimensionBrowser.MouseMove += new System.Windows.Input.MouseEventHandler(CubeDimensionBrowser_MouseMove);

            };

        }

 

        void CubeDimensionBrowser_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)

        {

            

            if (this.olapClient.CubeDimensionBrowser.ItemsSource is MetaTreeNodeCollection)

            {

                object obj = null;

                 if (e.OriginalSource is TextBlock)

                {

                    var a = (e.OriginalSource as TextBlock);

                    //ToolTipService.SetToolTip(a, a.Text);

 

                    var itemSource = (this.olapClient.CubeDimensionBrowser.ItemsSource as MetaTreeNodeCollection)[0];

 

                    foreach (var item in itemSource.ChildNodes)

                    {

                        if (item.Caption == a.Text)

                        {

                            obj = item;

                            break;

                        }

                    }

                    if (obj != null)

                    {

                        TextBlock tb = new TextBlock();

                        tb.Text = (obj as MetaTreeNode).NodeType + " : " + (obj as MetaTreeNode).Caption;

                        ToolTipService.SetToolTip(a, tb);

                    }

                    else

                    {

                        if(a.Text == "Growth in Customer Base")

                            ToolTipService.SetToolTip(a, "Shows the KPI for Growth in Customer Base");

                    }

                }

            }

        }

 

              

Figure: CubeDimension Browser with custom tooltip

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon