473,659 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ListView VirtualListSize Problems

Hi,

I am trying to use a 2.0 virtual listview, I thought it was all working fine
until I tried to remove an item from it. For example if the top of the list
is visible and I do:

myListView.Virt ualListSize = myListView.Virt ualListSize - 1;

It works fine, the scrollbar shrinks slightly so it's obvious the bottom has
been removed, but if the scrollbar is moved down slightly at all the line
throws the following exception:

System.NullRefe renceException: Object reference not set to an instance of an
object.
at System.Windows. Forms.ListView. Scroll(Int32 fromLVItem, Int32 toLVItem)
at System.Windows. Forms.ListView. set_TopItem(Lis tViewItem value)
at System.Windows. Forms.ListView. set_VirtualList Size(Int32 value)

Any ideas?

Thanks,

Stuart
Feb 16 '06 #1
0 1965

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

Similar topics

9
6115
by: Eva | last post by:
Hi, I wanted to know how i can enter values into a specific column of a listview. I have tried the following code but this seems to enter all my values into the first column!!! Can anyone please help me out on this?? hers my code so far.....
6
2320
by: Richard | last post by:
Hi. I use a ListView to display data in tabular form. Each ListView row corresponds to a data record. The ListView Item of the record is the record key or code. Each SubItem in that row represents a field from the record. I implemented a context menu so the user can "Copy" the cell content to the clipboard with this code:
2
2962
by: MikeY | last post by:
Hi all, I am coding window forms in C#. My problem is this: I have created a "Check ListView" or a 'ListView' with checkbox's. I have populated the it with my files from my folders, mps, txt, etc. The ListView is in Details, with headers and an Icon. What I am trying to accomplish is to rename/append check mark file massively (at once). This is accomplished by the user inputting a name into a provided
10
11332
by: Danny Tuppeny | last post by:
Hi All, I'm trying to find the best way to select an item in a ListView using the Virtual mode. My "items" are business classes, and I have a reference to once I want to select (passed from another dialog). One way is to spin through the items and compare the .Tag property to my business object (code below), however I fear the casts are probably costly (there could be a lot of servers). I also thought about spinning through the servers...
4
14473
by: Archimed | last post by:
Hi, I try to use an ImageList with a ListView but that don't work. I make a ListView in VirtualMode with LargeIcon view. I put the ImageList in the LargeImageList property. I add a bitmap to the ImageList When i want to see the item "icon" with the imagelist imageindex
4
6083
by: gene kelley | last post by:
I had a VB6 app that used a third party ListView control to simply display various recordsets. The control had a VirtualMode which I used for this display. Now in VB2005, I want to do the same with the native ListView to display various datasets in VirtualMode. I have a ListView with the VirtualListSize set and the appropriate columns in place which is all similar to the old VB6 app. However, the similarities end there as I can't find...
3
2392
by: Michael.Suarez | last post by:
Is it me, or does it seem like they put no effort into creating the listview control in .Net. listview. A few gripes I have with .Net listview that aren't present in vb6: -Inability to set tooltiptext of subitems (without the use of a very inconveniant work around). -Inability to display images in subitems (without using the windows api
1
2456
by: Duracel | last post by:
Is there a maximum number for the VirtualListSize property when using a list view in Virtual Mode? When I set it to 1,000, 10,000 or 100,000 I seem to be able to scroll the correct number of items, but when I set it to 1,000,000 the scroll bars behave like there are 1,000,000 items, but rendering doesn't reflect that number. The "index" property in the owner draw render override seems to state the correct number however. For example,...
1
2628
by: NvrBst | last post by:
I have a ListView (VirtualMode) and I want to implement a SelectAll. --1st Atempt-- The standard for loop takes way to long: "for(int i = 0; i < listView1.VirtualListSize - 1; i++) listView1.SelectedIndices.Add(i);". I've tried wrapping the above statment in a "listView1.SuspendLayout() / listView1.ResumeLayout(false)" but it didn't help. 3000 Elements takes about 15 seconds to select with this.
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.