How come the UltraTree control fires a DoubleClick event, when I doubleclick on the scrollbar?
The result is that DoubleClick fires, when a user is scolling up or down, and is clicking a little bit too fast on the up or down arrows.
Is there a way to disable or work around this feature?
Regards,
Jørn
I don't have a concise repro scenario to upload at the moment.
Yes, I checked that the event wasn't being fired.
I am handling the AfterSelect event to start a potentially lengthy operation. I thought maybe the double-click timing was getting disturbed with so much time spent on the first click, so I put the time-consuming parts into a timer tick event handler. That fixed most of the problem, which looks increasingly application-specific, so consider it resolved. I'll post again if I run out of ideas.
Thanks for responding so quickly.
The DoubleClick (and MouseDoubleClick) event is raised by the System.Windows.Forms.Control class, so I have no explanation for why the event would not be raised when the cursor is positioned over certain nodes. I assume you put a breakpoint at the entry point of the event handler and confirmed that the event itself is not firing. If possible, please attach the test project so we can take a look.
I was sloppy in referring to child bands, so here it is again.
Only in the child rows of the first row of the root band, a double-click on an unselected row doesn't raise a double-click event. In child rows of subsequent rows of the root band, the event is fired as expected.
Thanks for the code samples. I was able to use them to quickly solve most of my current problem, but there's still an issue.
To summarize, I have a tree in grid mode with two bands. The root band forbids selection. Double-clicks expand or collapse a node. The child band allows selection (extended across multiple parents). I want to reserve double-clicking for entering edit mode.
Using the above code, I recognize when to enter edit mode when double-clicking a selected row. It almost always works.
My problem is that, only in the very first child band, if a row isn't already selected, double-clicking it doesn't raise the double-click event, so that I have to double-click again. I experimented with different click speeds, and there's no question that the double-click should be happening but isn't. All other child bands register the first double-click for as-yet-unselected rows.
Any ideas?
If you like you can submit a feature request for a NodeDoubleClick event. You could use the code I posted in MouseDoubleClick, and programmatically expnad the node if the hit was not on an expansion indicator.