471,314 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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.VirtualListSize = myListView.VirtualListSize - 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.NullReferenceException: 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(ListView Item value)
at System.Windows.Forms.ListView.set_VirtualListSize( Int32 value)

Any ideas?

Thanks,

Stuart
Feb 16 '06 #1
0 1811

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Archimed | last post: by
4 posts views Thread by gene kelley | last post: by
3 posts views Thread by Michael.Suarez | last post: by

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.