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.
Unfortunately, activation email could not send to your email. Please try again.

How to load the data from SQLite offline database into SfSchedule?

SfSchedule allows you to bind the data from local database by using SQLite. To achieve this, you need to follow the below steps.

Step 1: Create a SQLite database table.

Step 2: Populate the data into the table.

Step 3: Store them as an ObservableCollection.

Step 4: Bind it to SfSchedule using SfSchedule.DataSource property.

Step 5: Refer the following link to know how to create SQLite connection,
http://developer.xamarin.com/guides/xamarin-forms/working-with/databases/

Note: To run this sample in UWP, install sqlite.net.pcl, version v1.0.10 (Only this version of SQLite supports UWP platform, later versions don’t support UWP).

Refer the following code which illustrates, how to create a SQLite database table and insert items in it.

C#

 

Note: Since SQLite doesn’t support for DateTime type, we have used it as string type and convert it to DateTime while adding items to local collection from DB.

C#

 

Refer the following code to bind the data from the SQLite database to SfSchedule.

XAML

 

Note: For appointment mapping you need to have different model class other than DB modal class, since DB modal class doesn’t support for certain datatype.

 

Please refer the below UG link for more details about creating custom appointment mapping.

 

https://help.syncfusion.com/xamarin/sfschedule/getting-started#adding-custom-appointments

 

 

Sample Link: SampleDemo

Article ID: Published Date: Last Revised Date: Platform: Control:
9125 08/13/2018 08/21/2018 Xamarin.Forms SfSchedule
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.