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

can I run any code After resize Occurrence?

1 Answer 53 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gts
Top achievements
Rank 1
Gts asked on 14 May 2014, 10:12 AM
Hi. Can I run any code after resize Occurrence? For example E have event appointment with start time 10:00 and and time 11:00
user resize this occurrence and set new time interval from 10:00 to 11:30. And I need show user my custom dialog with question. for example "Do you want change time for current user or for All users) and after user selection I must run my code.
How can I do this?

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 16 May 2014, 09:08 AM
Hi,

There are several ways that you can do this:

1.You can customize the resize behavior by implementing custom DragDropBehavior class and override the Resize method as it is described in our documentation. In this method you can display dialog and modify the resized appointment.

2.Use AppointmentEditing/AppointmentEdited events and execute your code there. In this case you will still need to override the Resize method in order to recognize whether the appointment is edited by resize.
For example:
operation can be easy. Here is sample code:
public class CustomDragDropBehavior : ScheduleViewDragDropBehavior
{
    public ScopeFlag IsResizing { get; set; }
 
    public CustomDragDropBehavior()
    {
        this.IsResizing = new SingleScopeFlag();
    }
 
    
 
    public override void Resize(DragDropState state)
    {
        using (this.IsResizing.BeginScope())
        {
            base.Resize(state);
        }
    }
}

private void OnRadScheduleViewAppointmentEdited(object sender, Telerik.Windows.Controls.AppointmentEditedEventArgs e)
{
    var scheduleView = (RadScheduleView)sender;
    var customDragDropBehavior = (CustomDragDropBehavior)sv.DragDropBehavior;
    if (customDragDropBehavior.IsResizing.IsActive)
    {
        RadWindow.Alert("Changed by drag-drop/resize");
    }
}

In this example a class from Telerik's assemblies was use for the flag - SingleScopeFlag. However you can always use a simple boolean flag that is true while the drag or resize operation is happening.

3.You can customize the dialog that is displayed by design when an occurrence of recurring appointment is edited and then again use the AppointmentEdited to save the changes.

Regards,
Rosi
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ScheduleView
Asked by
Gts
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Share this question
or