Double click in tree node

6 posts, 1 answers
  1. Steve
    Steve avatar
    8 posts
    Member since:
    Dec 2007

    Posted 24 Nov 2008 Link to this post

    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!
  2. Answer
    Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 24 Nov 2008 Link to this post

    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. :)
  3. DevCraft banner
  4. Steve
    Steve avatar
    8 posts
    Member since:
    Dec 2007

    Posted 25 Nov 2008 Link to this post

    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
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 26 Nov 2008 Link to this post

    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.
  6. micr0man
    micr0man avatar
    8 posts
    Member since:
    Aug 2007

    Posted 26 Nov 2008 Link to this post

    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
  7. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 26 Nov 2008 Link to this post

    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.
Back to Top
DevCraft banner