Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Using Grouping in listview, whose content is saved in an SQLite database

$
0
0

I want to group the data I have saved in an SQLite database by the content of one column from this database and load them in a listview. I have partly figured out how to load a column. I used this function but it only returned the 3 entries I have and not the right dates. It instead returned 01/01/01/0001 00:00:00.
public Task<List> GetCalendarEntriesStartDates()
{
return calendarentrydatabase.QueryAsync("SELECT DISTINCT [CalendarEntryStartDate],[CalendarEntryId] FROM [CalendarEntry] ORDER BY [CalendarEntryStartDate]");
}
I also find out how to create a class for the grouped content, but I don't know how to load the content in these groups.
public class CalendarGroup : IEnumerable
{
public DateTime CalendarEntryStartDate { get; set; }
public ObservableCollection CalendarEntries { get; set; }
IEnumerator IEnumerable.GetEnumerator()
{
return CalendarEntries.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return CalendarEntries.GetEnumerator();
}
}
Can someone explain to me how to do this, by using SQLite-net-plc?


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>