RadiantQ Forum

Product => WPF Gantt Package => Topic started by: ricky.blankenaufulland on November 27, 2015, 01:49:27 PM

Title: Multi task drag-and-drop / move
Post by: ricky.blankenaufulland on November 27, 2015, 01:49:27 PM
I would like to be able to select more than one task (for example using ctrl key) which should be easy. But then I would like to stretch/move them all together. Would this be possible?
Title: Re: Multi task drag-and-drop / move
Post by: ForumAdmin on November 29, 2015, 03:43:30 PM
Hi Ricky,

You can implement this using the following approach:

a) First track the selected tasks - you mentioned you have already figured this.

b) Listen to this event which gets called when a task is Shifted:
Code: [Select]
            ShiftAndConnectionTracker.Global.PropertyChanged += Shifter_PropertyChanged;

        void Shifter_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if(e.PropertyName == "ProposedStartTime")
            {
                ShiftAndConnectionTracker shifter = ((ShiftAndConnectionTracker)sender);
                DateTime newStart = shifter.ProposedStartTime;
                IActivity activity = ((GanttTaskItemBar)shifter.CurrentRenderer).ActivityView.Activity;
                CustomTask task = ((DataBoundActivity)activity).DataSource as CustomTask;

                // Shift the selected tasks here.
            }
        }

If the above works we can elaborate on how to do this for resizing too.

Thanks
RQ Support
Title: Re: Multi task drag-and-drop / move
Post by: ricky.blankenaufulland on December 01, 2015, 02:07:34 PM
Thanks, I will check this out and come back.