Listview question

B

BobLaughland

Hi All,

I had trouble finding a good WPF group??

My question is to do with the WPF listview control.

I have a listview which is displaying logging. It is quite often
updated, and items are added to the top of the list as new log
messages are captured.

The trouble is when you scroll down part way through the list, and a
new item is added to the list it makes the list move. That is really
annoying if you have found what you want to look at part way through
the list, and it just keeps moving. Eventually the place you have
scrolled to will scroll right out of view.

The solution would be something like this,

1) A new item is about to be added to the list
2) Take note of the first item that is currently displayed
3) Add the new item
4) Scroll the list so that the previous first item is now the first
item again

I have not found anything in the listview class that sets / gets the
scroll position, or the first item displayed (this can be done using
TopItem in winforms).

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.topitem.aspx

Any ideas?
 
G

Guest

Hi All,

I had trouble finding a good WPF group??

My question is to do with the WPF listview control.

I have a listview which is displaying logging. It is quite often
updated, and items are added to the top of the list as new log
messages are captured.

The trouble is when you scroll down part way through the list, and a
new item is added to the list it makes the list move. That is really
annoying if you have found what you want to look at part way through
the list, and it just keeps moving. Eventually the place you have
scrolled to will scroll right out of view.

The solution would be something like this,

1) A new item is about to be added to the list
2) Take note of the first item that is currently displayed
3) Add the new item
4) Scroll the list so that the previous first item is now the first
item again

I have not found anything in the listview class that sets / gets the
scroll position, or the first item displayed (this can be done using
TopItem in winforms).

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview...

Any ideas?

I think this can help
http://stackoverflow.com/questions/209416/in-a-wpf-listview-how-can-i-prevent-auto-scrolling
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top