473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

ListView problem

Hello,

Anyone know how to scroll down the listview by code?
Eg. I have 200 items in the listview. When I set the selectedItem to be
item 180, the user cannot see it if he don't scroll it down.

Thanks!
Nov 15 '05 #1
4 5458
Use the EnsureVisible method. Pass in the index of the item you want to
scroll into view.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"alan" <ab*@hotmail.com> wrote in message
news:u%****************@TK2MSFTNGP11.phx.gbl...
Hello,

Anyone know how to scroll down the listview by code?
Eg. I have 200 items in the listview. When I set the selectedItem to be item 180, the user cannot see it if he don't scroll it down.

Thanks!

Nov 15 '05 #2

Hi Alan,

Thanks for posting in this group.
You can use ListView.EnsureVisible method to force listview auto scroll to
your wanted item.

If the item that you want to ensure is visible is located above the
viewable region of the ListView control, calling the EnsureVisible method
will scroll the contents of the control until it is the first item in the
viewable area of the control. If the item is below the viewable region of
the ListView control, calling the EnsureVisible method will scroll the
contents of the ListView control until the item is the last item in the
viewable area of the control.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3
Use the EnsureVisible method. Pass in the index of the item you want to
scroll into view.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"alan" <ab*@hotmail.com> wrote in message
news:u%****************@TK2MSFTNGP11.phx.gbl...
Hello,

Anyone know how to scroll down the listview by code?
Eg. I have 200 items in the listview. When I set the selectedItem to be item 180, the user cannot see it if he don't scroll it down.

Thanks!

Nov 15 '05 #4

Hi Alan,

Thanks for posting in this group.
You can use ListView.EnsureVisible method to force listview auto scroll to
your wanted item.

If the item that you want to ensure is visible is located above the
viewable region of the ListView control, calling the EnsureVisible method
will scroll the contents of the control until it is the first item in the
viewable area of the control. If the item is below the viewable region of
the ListView control, calling the EnsureVisible method will scroll the
contents of the ListView control until the item is the last item in the
viewable area of the control.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steph. | last post by:
I use a ListView in a form to display Data from an SQL db. My problem is that I can fill the listview in less than a second when I show the form AFTER filling the listview, but I take 35...
15
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
0
by: Sérgio Almeida | last post by:
Greetings I have a problem using listview control. Well, I belive that this is not realy a problem, but it's consuming me precious time. Here is the scenario (an example of my problem). I...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
4
by: firefox | last post by:
Hola Foro!, tengo una rutina que permite agregar varios elementos o items de una sola vez en un ListView. Lo que sucede es que en el momento que se añaden los items al ListView se pone todo blanco,...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
3
by: Martin Panggabean | last post by:
Hello All, I've kind a logic problem ... I want to fill the listView control in VB.NET with data in my mySql table using Datareader object component. But It seems that the way of how listView...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
2
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I am attempting to insert a simple record with LinqDataSource from a ListView, however I always get a message saying "....LinqDataSource 'dataSource' has no values to insert. Check that the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.