Noremacam
Member
- Joined
- Jun 30, 2008
- Messages
- 14
- Programming Experience
- 1-3
I've searched the forum but couldn't find an answer, so I hope this isn't a duplicate. I have a listview(set as a details view) that is generated from a query to my database. I have a timer set to, every 5 minutes query the database and refresh the listview with a fresh copy, so that if someone else is on the database, the app stays relatively recent, which is satisfactory for what I'm using it for.
However whenever the listview gets repopulated with the new data, I lose which item I have selected.How do I go about having it remember which item was selected and then selecting that item again after refresh? There's no guarantee it'll be at the same location on the list, or that the item will still even be there(that's the only time it would make sense to have no selection after a refresh). If it helps, I'm not using MultiSelect, and every item name is guaranteed unique.
In short, how do I keep my selection highlighted after repopulating my listview?
Thanks in advance for any help you can give me!
However whenever the listview gets repopulated with the new data, I lose which item I have selected.How do I go about having it remember which item was selected and then selecting that item again after refresh? There's no guarantee it'll be at the same location on the list, or that the item will still even be there(that's the only time it would make sense to have no selection after a refresh). If it helps, I'm not using MultiSelect, and every item name is guaranteed unique.
In short, how do I keep my selection highlighted after repopulating my listview?
Thanks in advance for any help you can give me!