Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh list view but keep position

Status
Not open for further replies.

dazzer123

IS-IT--Management
Nov 24, 2003
128
GB
I have a list view on a windows form that is populated from an SQL server database. There is a timer on the form on the tick of which the list view 'refreshes' and the data contained in the list view is updated.

What I would like to happen is, when the list view is updated, the vertical scroll bar postion remains where it was before the list view was refreshed
 
Hello,
remember ListBox1.SelectedIndex and set it to old value after refresh


Jimmy Le
nhan_tiags@yahoo.com
 
Correct me if i'm wrong but wont ListBox1.SelectedIndex only return those values that are selected, since there are no selected values within the list box wont this return Null or 0.

My problem is that as the user scrolls down the list view to read the data contained in it if the timer ticks and the data is refreashed the verticle scroll bar returns to the top and the user has to scroll down again. As the list view is refreshed once every 2.5 seconds this means that the user can never read all of the data in the list view without it returning to the top.

The volume of data in the list will never change but the actual figures will so I think what I need is to know the position of the scroll bar just before refresh so that I can return it to that postition afterwards.

The data that is populating the list view is data from our phone system and needs to be up to the minute all the time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top