RadiantQ Forum
Product => WPF Gantt Package => Topic started by: Marlene.Witsch on June 10, 2016, 08:47:09 AM
-
I know you can get the DateTime for a x position. Now I was wondering if it is possible to get a task with for example the mouse position or just a x and y corrdinate?
Regards,
Marlene
-
Marlene, yes you can. But, to begin with can you tell us what exactly you are trying to implement? We will confirm that you are following the right/best approach and then we will also share some code.
Thanks,
- Raja.
-
Oh sry for the long time for my reply. I can have multiple tasks in the same row at the same time window (using dynamic row height). And I want to drag an object on to a task.
Now I already have a drop target on the row so i can not use the task as drop target since the drop target of the row swallow the one for the task.
Currently i handle this situation via the drop handler of the row, by using the get time via X position of mouse and then check via code if there is a task at that time. If there is more then one i will sadly throw a error message saying that there are to many task and the object can not be assigned.
-
Marlene,
You can get the GanttTaskItemBar if you can get hold of "OriginalSource" on drop handler like this,
GanttTaskItemBar taskBar = Extensions.FindAncestor<GanttTaskItemBar>(e.OriginalSource as FrameworkElement);
The "taskBar" will be null if there is no task on drop location.
Thanks,
- Raja.