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

Double click in tree node

5 Answers 142 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 24 Nov 2008, 09:21 PM
Hello,

I would like to know if there is a way to do my own function call on the double click of an item. I would like to refresh another control in my silverlight app when a node is double click.

Thanks for your help!

5 Answers, 1 is accepted

Sort by
0
Accepted
Serrin
Top achievements
Rank 1
answered on 24 Nov 2008, 09:30 PM
Hey Steve,

All the wonders of Silverlight, they don't have anything that handles double-click by default. 

You might want to check out this link to a blog post about double clicking in a grid...  you just need to convert it to work for tree nodes:

http://jtango.wordpress.com/2008/11/02/handling-a-doubleclick-on-gridrow-in-silverlight/

I use it on my datagrid and it works like a charm. :)
0
Steve
Top achievements
Rank 1
answered on 25 Nov 2008, 01:51 PM
That's a really nice class, but I don't see I can put this on every node of the treeview... If you know of a way I don't see please tell me. I really need this to work.

Thanks
0
Valentin.Stoychev
Telerik team
answered on 26 Nov 2008, 11:03 AM
Hello Steve,

There is no double click event on a framework level that you can use. We are handing the MouseLeftButtonDown event and you can not create a custom simulated double event either. The only option is if we raise such an event as a future improvement of the control.

What is your scenario? Why you need the double click event?

All the best,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
micr0man
Top achievements
Rank 1
answered on 26 Nov 2008, 01:25 PM
I have a treeview with a list of Article, the click is use to show the Cue of the article which is a child node or treewiew item. Now when I double click the article, it shows in another control the content of the selected article.

I manage to make it work with the class provided above. You attach the event handler MouseLeftButtonUp in the loaded handler of a stack panel to catch every click and know when a double click happens. It work pretty well.

Thanks
0
Valentin.Stoychev
Telerik team
answered on 26 Nov 2008, 05:33 PM
Hi Steve,

great workaround - thanks for sharing your scenario aswell.

Kind regards,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Steve
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Steve
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
micr0man
Top achievements
Rank 1
Share this question
or