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.
Unfortunately, activation email could not send to your email. Please try again.

How to customize the Tooltip of the Cube Dimension Browser

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

 

Article ID: Published Date: Last Revised Date: Platform: Control:
2776 11/21/2014 11/25/2014 Silverlight OlapClient
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.