This is a migrated thread and some comments may be shown as answers.

Drag & Drop and Resize Destination Slot Info

2 Answers 57 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jesus
Top achievements
Rank 1
Jesus asked on 28 May 2013, 08:50 PM
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 Answers, 1 is accepted

Sort by
0
Jesus
Top achievements
Rank 1
answered on 29 May 2013, 04:50 PM
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.
0
Kalin
Telerik team
answered on 31 May 2013, 09:56 AM
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.

Tags
ScheduleView
Asked by
Jesus
Top achievements
Rank 1
Answers by
Jesus
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or