B Oprit

B Oprit

  • 1.3k
  • 429
  • 4.1k

From Sqlite database to editor xamarin forms

Mar 22 2020 2:18 AM
Found a todo list and it is showing the saved items in a Listview , i change it so i only see ID nr 1 in the listview.
 
In OnAppearing it is filling the Listview , but what to change it to show " Name " to an Editor or Entry ?
 
But how do i show the Name of ID nr 1 in a Editor or Entry ?
  1. public class TodoItem  
  2. {  
  3. [PrimaryKey, AutoIncrement]  
  4. public int ID { getset; }  
  5. public string Name { getset; }  
  6. public string Notes { getset; }  
  7. public bool Done { getset; }  
  8. }  
  9. public Task GetItemsNotDoneAsync()  
  10. {  
  11. return Database.QueryAsync<TodoItem>("SELECT * FROM [TodoItem] WHERE [ID] = 1"); }  
  12. protected override async void OnAppearing()  
  13. {  
  14. base.OnAppearing();  
  15. listView.ItemsSource = await App.Database.GetItemsNotDoneAsync();  
  16. }  

Answers (1)