Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
tooltip for xamwebtree
posted

I am dynamically creating xamwebtree. I want to show tooltip only for those nodes whose text is not completly visible. Any quick response will be appreciated.

Parents
No Data
Reply
  • 995
    posted

    Hi Rawat,

     

    You can use some logic to adding a Tooltip to the tree node based on the length of the header like:

     

    private void Button_Click(object sender, RoutedEventArgs e)

            {

                XamWebTreeItem item = new XamWebTreeItem();

                item.Header = igTxt.Text;

                string header = igTxt.Text;

                if (header.Length > 20)

                {

                    ToolTip tooltip = new ToolTip() { Content = item.Header };

                    ToolTipService.SetToolTip(item, tooltip);

                }

                xamWebTree1.Items.Add(item);

            }

    Where is the igTxt is text box.

     

Children