Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Scroll Schedule when dragging appointment

Not answered Scroll Schedule when dragging appointment

Feed from this thread
  • Simon avatar

    Posted on Oct 10, 2011 (permalink)

    Hi,

    In week view, is it possible to auto scroll the schedule when dragging the appointment to the right or left edges of the current view, thus allowing appointments to be dragged into another week?

    Does anyone have any working sample code?

    Thanks

    Simon

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Oct 13, 2011 (permalink)

    Hello Simon,

    Thank you for your question.

    Currently, such functionality could not be implemented due to the internal implementation of RadScheduler. You are the first one to request such functionality and if more people request this, our team will consider implementing it in a future release.

    I hope this information is useful.

    Regards,
    Ivan Todorov
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Simon avatar

    Posted on Oct 13, 2011 (permalink)

    Hi,

    When you say this can't be done. Which aspect cannot be done?
    I can make the ActiveView.StartDate increment/decrement by 7 days when I drag an appointment close to the right or left hand edge. Then, I can update the Appointment Start and End to move to the next week.
    However, unless I toggle the view, it does not seem to repaint the Appointment in its new position. It feels like I am close to getting this to work but need some help on the home stretch.

    Regards

    Simon Jackson

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Oct 14, 2011 (permalink)

    Hi Simon,

    I was able to achieve similar to the desired behavior by handling the MouseMove event of the RadScheduler control. Below is the implementation of it:
    private void radScheduler1_MouseMove(object sender, MouseEventArgs e)
    {
        if (e.Button == System.Windows.Forms.MouseButtons.Left &&
            this.radScheduler1.SchedulerElement.DragDropBehavior.IsDragging &&
            e.Location.X > this.radScheduler1.Size.Width)
        {
            IEvent draggedApp = this.radScheduler1.SchedulerElement.DragDropBehavior.ActiveFeedback.AssociatedAppointment;
            this.radScheduler1.SchedulerElement.DragDropBehavior.Drop();
            DateTime newStart = this.radScheduler1.ActiveView.EndDate.AddDays(1);
            TimeSpan oldDuration = draggedApp.Duration;
            draggedApp.Start = newStart;
            draggedApp.Duration = oldDuration;
            this.radScheduler1.ActiveView.StartDate = newStart;
        }
    }

    This code moves the appointment to the next week, but ends the drag operation. This is the closest to the desired behavior I could achieve.

    The current architecture of RadScheduler is such that the drag operation cannot continue when the view is changed. In order to be able to implement such functionality, we need to replace the whole drag-and-drop logic which a fairly big task. That is why I cannot provide you with specific time frame in which we will address this request. I have logged this in our Public Issue Tracking System so you can subscribe to it and get notified about any changes of its status. Here is the link to the PITS item. As it gets more votes we will consider addressing it with higher priority.

    I hope this is useful. Please let me know if you have any further questions.

    Greetings,
    Ivan Todorov
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

    Reply

  • Simon avatar

    Posted on Oct 14, 2011 (permalink)

    Hi Ivan,

    That is exactly what I was looking for.
    Yes, I understand that your drag/drop is built around a single view. I hope you get chance to develop it further.

    Kind regards

    Simon

    Reply

  • Shawn Shaddock avatar

    Posted on Feb 9, 2012 (permalink)

    I also require this functionality.

    For example:
    I am using Resource grouping (for employees) and showing 4 resources. We need to be able to drag an appointment from one resource to another resource which is potentially not one of the 4 resources that are being displayed. Dragging to the edge and having the schedule scroll over to other resources would solve this issue.

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Feb 14, 2012 (permalink)

    Hi Shawn,

    By using the same approach as in my previous post, I have managed to create a working example. Here is the source code:
    private void radScheduler1_MouseMove(object sender, MouseEventArgs e)
            {
                if (e.Button == System.Windows.Forms.MouseButtons.Left &&
                    this.radScheduler1.SchedulerElement.DragDropBehavior.IsDragging &&
                    (e.Location.X > this.radScheduler1.Size.Width || e.Location.X < 0))
                {
                    int step = 1;
                    if (e.Location.X < 0)
                    {
                        step = -1;
                    }
     
                    IEvent draggedApp = this.radScheduler1.SchedulerElement.DragDropBehavior.ActiveFeedback.AssociatedAppointment;
                    this.radScheduler1.SchedulerElement.DragDropBehavior.Drop();
     
                    SchedulerDayViewGroupedByResourceElement dayView = this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewGroupedByResourceElement;
                    SchedulerMonthViewGroupedByResourceElement monthView = this.radScheduler1.SchedulerElement.ViewElement as SchedulerMonthViewGroupedByResourceElement;
                    TimelineGroupingByResourcesElement timelineView = this.radScheduler1.SchedulerElement.ViewElement as TimelineGroupingByResourcesElement;
     
                    if (dayView != null)
                    {
                        dayView.NavigateToResource(dayView.ResourcesHeader.StartIndex + step);
                        draggedApp.ResourceId = this.radScheduler1.Resources[dayView.ResourcesHeader.StartIndex].Id;
                    }
                    if (monthView != null)
                    {
                        monthView.NavigateToResource(monthView.ResourcesHeader.StartIndex + step);
                        draggedApp.ResourceId = this.radScheduler1.Resources[monthView.ResourcesHeader.StartIndex].Id;
                    }
                    if (timelineView != null)
                    {
                        timelineView.NavigateToResource(timelineView.ResourcesHeader.StartIndex + step);
                        draggedApp.ResourceId = this.radScheduler1.Resources[timelineView.ResourcesHeader.StartIndex].Id;
                    }
     
                    this.radScheduler1.SchedulerElement.InvalidateMeasure(true);
                    this.radScheduler1.SchedulerElement.UpdateLayout();
                }
            }

    Hope you find it useful.

    Greetings,
    Ivan Todorov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Scroll Schedule when dragging appointment
Related resources for "Scroll Schedule when dragging appointment"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]