none
mouseDown event for treeviewitem

    Question

  • for treeview item mouse down event is not working if you click by left mouse button on that treeviewitem, but mousedown is working if you click on right mouse button. Why this is behaving like this? how to overcome this?

    i need mousedown event for treeview item to perform some logic on that perticular item, and selection change event will not fire if i click on same item again so i need mousedown event for that.....

    any idea?
    Thursday, February 28, 2008 11:50 AM

Answers

  • The bubbling version of the MouseLeftButtonDown event has been handled down the visual tree chain by the TreeView, you can use the tunnelling version aka PreviewMouseLeftButtonDown event instead, this should be able to fullfil your requirement.

    Hope this helps
    Monday, March 3, 2008 2:50 AM

All replies

  • There's two different events for handling your requirement: MouseDown and PreviewMouseLeftButtonDown. Have you tried both of them? Guess you should check out the second one.

     

    Also pay attention to the customized templates for treeview as there might be slightly different logic to handle events.

     

    Thursday, February 28, 2008 1:01 PM
  • The bubbling version of the MouseLeftButtonDown event has been handled down the visual tree chain by the TreeView, you can use the tunnelling version aka PreviewMouseLeftButtonDown event instead, this should be able to fullfil your requirement.

    Hope this helps
    Monday, March 3, 2008 2:50 AM