10432 : Separating a click from a move etc

Question

I would like the user to be able to change start and stop dates by moving the time item and dragging the start or stop. I would also like the user to click on the time item to get a new window up with more detailed information. I have problems to find out when the user has clicked on a time item, is there an easy way to do that? The events that I can think of (OnTimeItemAreaClick, OnTimeItemAreaMouseDown…) are all fired together with AfterMove, StartValueResize, and StopValueResize.

Answer

implement OnTimeItemAreaMouseDown, in this event check the Gantt.MouseMoveKind property, it can take on values like none,move,resizew,resizee,linkCreate,timeItemCreate,linkReAssign

This information combined with the standard event parameters like e.Clicks==2 can help you catch a double.

If you just want to catch a single click you should know that we interpet this as a select of that time item. So you can implement OnTimeItem_SelectionChanged to catch these.

 

Leave a Reply