We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get dropped resource in Xamarin.Forms Schedule (SfSchedule)

Platform: Xamarin.Forms |
Control: SfSchedule |
Published Date: March 6, 2020 |
Last Revised Date: March 6, 2020

You can get the dropped resource of SfSchedule in Xamarin.Forms using DropResourceItem in the AppointmentDrop event.

XAML

<syncfusion:SfSchedule
                x:Name="schedule"
                AllowAppointmentDrag="true"
                ScheduleView="TimelineView" 
                DataSource="{Binding Events}"
                ScheduleResources="{Binding Employees}"
                SelectedResources="{Binding SelectedEmployees}"
                ShowResourceView="True"
                ResourceViewMode="Absolute"/>

C#

public class SchedulerPageBehavior : Behavior<ContentPage>
{
    SfSchedule schedule;
 
    private void WireEvents()
    {
        this.schedule.AppointmentDrop += Schedule_AppointmentDrop;
    }
 
    private void Schedule_AppointmentDrop(object sender, AppointmentDropEventArgs e)
    {
        var changedResource = e.DropResourceItem;
        App.Current.MainPage.DisplayAlert("", "Resorce change into " + (changedResource as Employee).Name, "ok");
    }
 
    private void UnWireEvents()
    {
        this.schedule.AppointmentDrop -= Schedule_AppointmentDrop;
    }
}

Download sample in GitHub

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon