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

Processing double click without expand and collapse behavior

4 Answers 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 17 Dec 2008, 04:48 AM
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).

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 Dec 2008, 03:30 PM
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.
0
Tom Chien
Top achievements
Rank 1
answered on 18 Nov 2009, 09:42 PM
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?
0
Nikolay
Telerik team
answered on 24 Nov 2009, 12:46 PM
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.
0
Tom Chien
Top achievements
Rank 1
answered on 02 Dec 2009, 03:33 PM
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

Tags
GridView
Asked by
David
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Tom Chien
Top achievements
Rank 1
Share this question
or