Hi,
On double clicking of a node I need to add it within a grid, that functions well as long as the user does not double click anywhere else in the control, that is the white space within the control or the scroll bar!!!....in those cases the double click event also fires and wrecks the app.
NodeDouble click is of no use as it only gives functionality about expanding....why can't you simply have a node double click even and leave the user to use it. Any workarounds for the situation. at present I am planning to set up some flags on mouse enter or mouse down....ughhhhh......the double click handling seems ugly to me....
What's wrong with the NodeDoubleClick event? If you don't want double-clicking on a node to automatically expand the node, set the NodeDoubleClickAction property .
No I was't saying that I dont want a node not to expand on double click.
What I want is that we should be able to customize the action that takes place on a double click. Currently, the NodeDoubleClickAction can be assigned only from an enumeration, which mean pretty much all I can do with it is either expand or collapse a node.
In my UI on double clicking a node, I was adding it some other UI control (let's say a dropdown), but since I cannot set any custom action for NodeDoubleClickAction, I will have to use the simple DoubleClickEvent, which means it will fire if the user click on any place within the surface of tree control and not just for the node that is clicked.
Also, I am now a bit confused, you mention NodeDoubleClick Event, but I dont think that is exposed actually, what we are exposed is a NodeDoubleClickAction property which we can assign from an enumeration...correct me if I am wrong.
Also am using the infragistics 6.1 version, in case the functionality is different in the newer version.
Right now I am using the GetNodeFromPoint method to find out whether the actual click happened on a tree node or some other place. But it does look a bit odd that double click event of a tree control should fire when it's scroll bar is clicked and not even send any information regarding that.
Piyush_Singh said:Also am using the infragistics 6.1 version, in case the functionality is different in the newer version.
Okay, I think the NodeDoubleClick event was added in a later release than v6.1. Not sure exactly when.
Piyush_Singh said:Right now I am using the GetNodeFromPoint method to find out whether the actual click happened on a tree node or some other place. But it does look a bit odd that double click event of a tree control should fire when it's scroll bar is clicked and not even send any information regarding that.
You are correct that it is unusual for a control to fire DoubleClick when it's scrollbar is double clicked. The reason this happens is that the DoubleClick event is an event on Control. It's not something that is specifically implemented on the WinTree control. Usually, ScrollBars in a control are displayed by the Window and are therefore not part of the client area, so double-clicking on them doesn't fire events. In the case of the Infragistics controls like UltraTree - this is not the case. The reason for this is that the Infragistics controls use the UltraScrollbar which has the ability to display with a lot more flexibility. For example, it can display using Windows XP themes, or you can Appearances to modify the colors or images of the different parts of the scrollbar. Since this is an UltraScrollbar and not a scrollable window, the scrollbars are part of the client area, and so you still get Click and DoubleClick events.
In any case, you really need to use NodeFromPoint, anyway. Even without the scrollbars, the user could still double-click on some part of the tree that is not a node and you would end up with the same problem.
Hey Mike,
Could you please let me know if there is any way we can capture the event whether user clicked on a row or some other part of the UltraGrid?.. so that we can handle the doubleclick and not fire the event.
Thanks In Advance
DoubleClickRow is an event of the WinGrid, not the tree.
Not sure where NodeDoubleClick came from. I guess I was assuming that the original poster was referring to an event, but you are right, there is no such event.
Using MouseDoubleClick is a good idea. You can use the tree's GetNodeFromPoint method to find the node that was double-clicked.
After looking at the user guide one more time I just answered my own question.
There is a 'MouseDoubleClick' event in addition to the standard 'DoubleClick' event.
The difference is that the MouseDoubleClick passes the location info in the 'e' argument so this can be used to determine which node, if any, was double clicked.
The suggestions in this thread say to use one of the following events: NodeDoubleClick DoubleClickRow
but neither of these events exist in your WinTree control. (I am using version 2011.2)
Currently I am having to store the click position when the MouseDown event fires and then use GetNodeFromPoint() in the DoubleClick event.
This is not a great solution since the code is not localized and therefore prone to error.
Is there a way to determine the click position of the double click itself (in the Doubleclick event) or some other way of determining which node (if any) the double click occured on.(As with the original reporter I have a custom double click action.)
You could use the DoubleClickRow event.