10641 : Getting the time from a point

Question

I am using dragdrop to drop a ‘template’ onto the Gantt. From the OnTimeItemAreaDragOver event is it possible to find the date/time at the current cursor position? This then will be displayed in the ‘template’ image which is being displayed at the cursor point.

Answer

Sure, you use the Gantt.DateScaler.PixelToTime(x coord). Be sure to convert the coordinate to TimeItemArea local coords since the DragDrop events give you window coords:

Point localpoint=gantt1.TimeItemArea.PointToClient(new Point(e.X,e.Y));