Drag & Drop and Resize Destination Slot Info

3 posts, 0 answers
  1. Jesus
    Jesus avatar
    9 posts
    Member since:
    Feb 2012

    Posted 28 May 2013 Link to this post

    Hi there!!!

    I have a situation here.....

    In Drag&Drop and Resize, I have to detect if any Appointment is in the place where the appointment will be or intersect in some point , I don´t do this because I don´t know how access to the destination place info.

    The DragDropStatus Info is about the current appointment info and I need the info where the appointment will be placed.

    Txs
    Saludos
    José de Jesús
  2. Jesus
    Jesus avatar
    9 posts
    Member since:
    Feb 2012

    Posted 29 May 2013 Link to this post

    Hi....

    I found a way to do this....
    foreach(DateSpan ds  in state.DestinationSlots)
                {
                    ServicioReservaciones.WSReservacionesSoapClient servicio = new ServicioReservaciones.WSReservacionesSoapClient();
                    servicio.SeEmpalmaAsync(ds.Start, ds.End, ds.Start, ds.End, 1);
                    servicio.SeEmpalmaCompleted += servicio_SeEmpalmaCompletedResize;
                    break;
                }


    DestinationSlots contains several DataSpans because multiple Drag&Drop is allowed.....
    I like to not allow multiple Drag & Drop, How I do this...?
    Also, if I want to  drag an Appointment from the Resource 1 to Resource 2, DataSpan don't tell me the resource I want to drop, how I do Access to this info?...

    Besides.... If I set this code:

    public override void Drop(Telerik.Windows.Controls.DragDropState state)
            {
                _currentState = state;
     
                var dialogParams = new DialogParameters()
                {
                    OkButtonContent = "Mover",
                    CancelButtonContent = "Cancelar",
                    Content = "Desea modificar este evento",
                    Closed = this.OnClosedDrop
                };
     
                RadWindow.Confirm(dialogParams);
     
            }
     
            private void OnClosedDrop(object sender, WindowClosedEventArgs e)
            {
                if (e.DialogResult == true)
                {
                    base.Drop(_currentState);
                    ServicioReservaciones.WSReservacionesSoapClient servicio = new ServicioReservaciones.WSReservacionesSoapClient();
                    foreach (SessionAppointment sesion in _currentState.DraggedAppointments)
                    {
                        servicio.DropAsync(sesion.UniqueId, rpe, _currentState.Appointment.Start, _currentState.Appointment.End);
                    }
                }
                _currentState = null;
            }

    I allowed Drag & Drop between Diferent resources, but with this:

    public override void Drop(Telerik.Windows.Controls.DragDropState state)
    {
        _currentState = state;
     
        foreach (DateSpan ds in state.DestinationSlots)
        {
            ServicioReservaciones.WSReservacionesSoapClient servicio = new ServicioReservaciones.WSReservacionesSoapClient();
            servicio.SeEmpalmaAsync(ds.Start, ds.End, ds.Start, ds.End, ((SessionAppointment)state.Appointment).Lugar);
            servicio.SeEmpalmaCompleted += servicio_SeEmpalmaCompletedResize;
            break;
        }
     
    }
    void servicio_SeEmpalmaCompletedDrop(object sender, ServicioReservaciones.SeEmpalmaCompletedEventArgs e)
    {
        if (e.Result)
        {
            var dialogParams = new DialogParameters()
            {
                Content = "Esta reservación no puede ocupar espacio de una reservación aprobada."
            };
            RadWindow.Alert(dialogParams);
        }
        else
        {
            var dialogParams = new DialogParameters()
            {
                OkButtonContent = "Mover",
                CancelButtonContent = "Cancelar",
                Content = "Desea modificar este evento",
                Closed = this.OnClosedDrop
            };
     
            RadWindow.Confirm(dialogParams);
        }
    }
    private void OnClosedDrop(object sender, WindowClosedEventArgs e)
    {
        if (e.DialogResult == true)
        {
            base.Drop(_currentState);
            ServicioReservaciones.WSReservacionesSoapClient servicio = new ServicioReservaciones.WSReservacionesSoapClient();
            foreach (SessionAppointment sesion in _currentState.DraggedAppointments)
            {
                servicio.DropAsync(sesion.UniqueId, rpe, _currentState.Appointment.Start, _currentState.Appointment.End);
            }
        }
        _currentState = null;
    }


    Only allow me Drag & Drop in the same Resource, What I´m doing wrong!!!!!.....


    Txs
    José de Jesús.
  3. DevCraft banner
  4. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 31 May 2013 Link to this post

    Hello Jesus,

    We have already created a sample project about How to Avoid Overlapping Appointments for WPF ( the same approach can be used in Silverlight). It should help you achieve the desired scenario. 
    As to the multiple appointment selection, I would suggest to check this help topic where it is explained how to customize the AppointmentSelectionBehavior of RadScheduleView.

    If you have any issues later please write to us again.

    Hope this helps.

    Regards,
    Kalin
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top