Processing double click without expand and collapse behavior

5 posts, 0 answers
  1. David
    David avatar
    2 posts
    Member since:
    Aug 2008

    Posted 16 Dec 2008 Link to this post

    I want a user to be able to double click on a node in the tree view and then perform an action associated with that node (e.g., "opening" it in my scenario).  I don't want double click to cause the tree to collapse/expand.  I only want collapse and expand if the user clicks on the + sign (or whatever that visual happens to be).
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 19 Dec 2008 Link to this post

    Hello David,

    Thank you for this question.

    Your scenario is possible with RadTreeView. You should get the number of clicks from the NodeMouseDown's RadTreeViewMouseEventArgs. If the number is equal to two, cancel the NodeExpandedChanging event. For additional information, please refer to the code snippet below:
    public partial class Form1 : Form  
    {  
        public Form1()  
        {  
            InitializeComponent();  
     
            this.radTreeView1.NodeExpandedChanging += new Telerik.WinControls.UI.RadTreeView.RadTreeViewCancelEventHandler(radTreeView1_NodeExpandedChanging);  
            this.radTreeView1.NodeMouseDown += new Telerik.WinControls.UI.RadTreeView.TreeViewMouseEventHandler(radTreeView1_NodeMouseDown);  
            this.radTreeView1.ExpandAnimation = Telerik.WinControls.UI.ExpandAnimation.None;  
        }  
     
        int clicks = 0;  
     
        void radTreeView1_NodeMouseDown(object sender, Telerik.WinControls.UI.RadTreeViewMouseEventArgs e)  
        {  
            clicks = e.OriginalEventArgs.Clicks;  
        }  
     
        void radTreeView1_NodeExpandedChanging(object sender, Telerik.WinControls.UI.RadTreeViewCancelEventArgs e)  
        {  
            if (clicks == 2)  
            {  
                e.Cancel = true;  
                clicks = 0;  
            }  
        }  

    We will consider implementing this behavior as a feature of RadTreeView in Q1 2009.

    I hope this helps. If you have additional questions, feel free to contact me.

    All the best,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 18 Nov 2009 Link to this post

    1. Is this thread in the right Forum?  All the references are to "Tree"'s or "RadTreeView"'s vs. "Grid"'s or "RadGridView"'s.

    2. Just in case it's supposed to work for "RadGridView"'s also, I tried it but the VS doesn't recognize "NodeExpandedChanging", "NodeMouseDown" or "ExpandAnimation" as being Members of my "RadGridView" and they're aren't in the docs for "RadGridView".  I need this workaround for my "RadGridView".

    3. As for "RadTreeView", was this fixed in Q1 2009 or later as suggested might happen by Nikolay's Dec. 19, 2008 post?
  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 24 Nov 2009 Link to this post

    Hello Tom Chien,

    This forum thread is regarding the RadTreeView control, but not the RadGridView control. It is in the RadGridView section, because the client initiated the thread in this section.

    As to the feature itself, we postponed it in favor of other more important features and fixes. I am not able to provide you with a specific time frame when the feature will be implemented.

    Regards,
    Nikolay
    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.
  6. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 02 Dec 2009 Link to this post

    Nevermind, I withdraw my request.  I just realized what I need is actually the opposite of this: http://www.telerik.com/community/forums/winforms/gridview/expanding-collapse-childgridviewtemplate-without-activating-double-click-action.aspx

Back to Top
UI for WinForms is Visual Studio 2017 Ready