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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind the SQLite database table as datasource in SfDataGrid

The SfDataGrid is bound to an external data source to display the data. SfDataGrid.ItemsSource property helps to bind the SfDataGrid with the collection of objects. It supports all popular data sources such as List, Observable Collection, and so on. In addition it also allows you to bind data from an external database.

In case, if you wish to bind the data from a SQLite database table, SfDataGrid allows you to achieve the same using the SfDataGrid.ItemsSource property. To do it, you have to create a SQLite database table, populate the data and store them as an IEnumerable collection and bind it to SfDataGrid. Refer the following link to know how to work with local databases of SQLite in Xamarin.Forms.
http://developer.xamarin.com/guides/xamarin-forms/working-with/databases/

 

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

OrderItem.cs

 

SampleDemoDatabase.cs

 

Refer the following code example for binding the data from a SQLite Database to a SfDataGrid.

App.cs

 

Sample Link:

http://www.syncfusion.com/downloads/support/directtrac/general/ze/SampleDemo1593704577

Article ID: Published Date: Last Revised Date: Platform: Control:
6190 01/28/2016 01/28/2016 Xamarin.Forms SfDataGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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