This is a migrated thread and some comments may be shown as answers.

Tooltip editable in treeview

1 Answer 69 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Grace Pahuasi
Top achievements
Rank 1
Grace Pahuasi asked on 13 Jan 2010, 04:01 PM
hi !
1. exists any way to have a editable tooltip in treeview ?
2.
        private void ToolTipNeeded(object sender, ToolTipTextNeededEventArgs e) 
        { 
            ... 
                    TreeNodeUI tree = (TreeNodeUI)sender; 
                    int level = tree.AssociatedTreeNode.Level; 
 
                    if (level == 0) 
                    { 
                        OnRaiseCustomEvent(new TooltipEventArgs(e)); 
                    } 
   } 
 
        private void OnRaiseCustomEvent(TooltipEventArgs args) 
        { 
            EventHandler<TooltipEventArgs> handler = RaiseCustomEvent
            if (handler != null) 
            { 
                //by the way  
                args.ToolTipText = new RadTextBox(); 
                args.ToolTipText.Text = "test";  
                handler(this, args); 
            } 
        } 
        private void HandleToolTipEvent(object sender, TooltipEventArgs e) 
        { 
            e.ToolTipText.Text = "444";  
        } 
 public class TooltipEventArgs : ToolTipTextNeededEventArgs 
    { 
        private RadTextBox txtTextBox; 
 
        public TooltipEventArgs(ToolTipTextNeededEventArgs args) 
        {            
            txtTextBox = new RadTextBox(); 
            txtTextBox.BackColor = Color.Transparent; 
            txtTextBox.ForeColor = Color.Black; 
            txtTextBox.Enabled = true
            txtTextBox.Text = "test"
            args.ToolTipText = txtTextBox.Text ; 
         } 
 

That code pretends show a textbox instead of string tooltip (but doesn't work), what I can do , to be able for view the textbox ?
:\
thanks  in advantage :]

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 15 Jan 2010, 04:10 PM
Hi Grace Pahuasi,

Thank you for writing. There is no way to include an editable control in the standard ToolTip. That is because - by specification - the ToolTip serves only for displaying text. You have to keep in mind that the ToolStrip hides when you move the mouse outside the object that owns it. This makes editing impossible. Instead of adding a RadTextBox in the way that you have tried in your code, I recommend you create a custom form object with a RadTextBox inside it that you can show and hide according to your needs. 

Do not hesitate to contact me again if you have any other questions.

Best wishes,
Martin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Treeview
Asked by
Grace Pahuasi
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or