c# - how to programmatically display the bottom row in virtual ListView -


i have virtual listview in winforms nicely displays contents database. items asynchronously added database , visible when pull scrollbar bottom.

now insure whenever asynchronous thread adds database updates listview knows index should bottom row. before added listview object, listbox set index should top index, based on itemheight , listbox height:

int numitems = listbox1.clientsize.height / listbox1.itemheight; if (listbox1.topindex == listbox1.items.count - numitems - 1)     listbox1.topindex = listbox1.items.count - numitems + 1; 

unfortunately neither itemheight nor topindex exist in listview.

but major question is: how tell virtual listview should display specific range of indexes - or insure index gets displayed?

you can use property topitem set top visible item in listview (no matter it's in virtual mode or not):

listview1.topitem = listview1.items[itemindex];//itemindex index of item  //you want make visible top item. 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -