locked
how to update selecteditem and insert into sqlite db? RRS feed

  • Question

  • User176749 posted

    I would like to achieve an insert similar to this app in the screenshot. basically there are list of exercises there and when you tap one, this pop arises to select the number of sets and when you click add button it will save exercise+set count together as 1 row into sqlite db table. lets say each item in the listview is an exercise object and it has also set property. When I click an exercise, I can bind to it is selecteditem property on the viewmodel and complete the insert simply but how can I fire that after clicking the button and update selecteditem with set propery, then acomplish the insert all together. because nothing is in the memory to update but only the listview with its items. I dont really know how to name this case thats why sorry for the title.:)

    Thursday, February 4, 2016 12:43 AM

Answers

  • User76916 posted

    @batmaci - not really sure what you are up to here.

    You bind a listview to your page and when you insert, you add to the listview propery. Normally on the add button you would trigger the code to insert into the DB. Then insert into the ListView ItemsSource property (if observable collection) or reassign if not an observable.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, February 4, 2016 2:17 AM

All replies

  • User76916 posted

    @batmaci - not really sure what you are up to here.

    You bind a listview to your page and when you insert, you add to the listview propery. Normally on the add button you would trigger the code to insert into the DB. Then insert into the ListView ItemsSource property (if observable collection) or reassign if not an observable.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, February 4, 2016 2:17 AM
  • User176749 posted

    I tried to add the image again. it is popup over the actual form. so how to insert value coming from popup together with the model bound to the view. this is the challenge for me.

    Thursday, February 4, 2016 11:29 PM