开发者

How to make listview reorder itself when item is inserted

开发者 https://www.devze.com 2023-03-17 21:38 出处:网络
I have a list view in which I can insert items(the items are inserted in the database). The problem is that when I insert an item, it shows at th开发者_Python百科e bottom of the list. How can I make i

I have a list view in which I can insert items(the items are inserted in the database). The problem is that when I insert an item, it shows at th开发者_Python百科e bottom of the list. How can I make it go to the right position? The items should in alphabetical order. If I exit the app and enter, the inserted item is at the right position.


After changes to DB like inserting / updating / deleting you need to call requery() to your cursor, e.g. dbCursor.requery();


you can do array sort with alphabets and then assign to listview so it will display alphabets display.

0

精彩评论

暂无评论...
验证码 换一张
取 消