Null reference Exception in ListView.InsertItem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm getting an intermittant null reference expception in
ListView.InsertItem. Since the top of the call stack is in winforms
code, I am not able to tell what is actually null. Here's the top of
the stack:

System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Windows.Forms.ListView.InsertItem(Int32 displayIndex,
ListViewItem item)
at System.Windows.Forms.ListViewItemCollection.Add(ListViewItem
value)

Has anyone experienced this before? Any ideas on what might be going
on here?

thanks for any help!
 
Most probably, the ListViewItem object being passed to InsertItem is null.

-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
 

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

Back
Top