VB.NET Listview - Insert NOT AddFull screen
VB.NET Topic list
I have a listview in VB.net that I'm filling from a table in my SQL database.
The listview refreshes every period of time (using a timer) and I want every
dynamically added item to be added on the TOP of the listview.
Here's my code:
Dim itm as Listviewitem
arr(0) = Date.Now.ToString
arr(1) = Table.item("no")
arr(2) = Table.item("datain")
arr(3) = Table.item("message")
itm = New ListViewItem(arr)
Use the Insert method instead of Add, like this:
Note: 0 is the index of the first item in the list, so this puts it at the beginning.
Instead of simply adding the item to the list, use the insert function :
For subitems the code is the same as ADD, only the LEAD item needs
the INSERT code.
Copyright © 2015-19 Allied Factors Limited. All Rights Reserved.