wpf - How to focus on the current ListView item that just add -


i have wpf application , listview. when add files listview can see first 10 items , when adding files can see vertical scroll bar , want when add files focus on last item added. try select last item:

listview.selectedindex = lvpcapfiles.items.count - 1; 

or

listview.selecteditem = lvpcapfiles.items.count - 1; 

but first option select last item focus still no there.

the second nothing.

you can use

 listview.selectedindex = lvpcapfiles.items.count - 1;  listview.scrollintoview(listview.selecteditem); 

there articles you. here


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -