ListView: Event when Item is added?

  • Thread starter Thread starter andreas.baus
  • Start date Start date
A

andreas.baus

Hello. Is there a way to add custom code that is executed every time a
ListViewItem is added to the Items collection of a ListView control?
There does not seem to be an event that I could hook into, and I can't
figure out how derive a custom ListViewItemCollection to override it's
Add() Method...
 
Thank you for your reply. Unfortunately, it didn't really help me as
it's exactly what I've been trying. But for some reason, deriving a
custom class from System.Windows.Forms.ListView.ListViewItemCollection
does not seem to work right. It doesn't cause any compiler errors, but
the new class doesn't inherit any of the original members of
ListViewItemCollection. Sure, I can just completely wrap it by
recreating every member and redirecting each call to base but that is
somewhat clumsy and kind of defeats the purpose of inheritance, doesn't
it...

(just in case it makes a difference, I'm still using .NET 1.1, not 2.0)
 
Oh, wait, nevermind... the method inheritance seems to work properly,
it's just that IntelliSense and the Object Browser seem to be unable to
recognize it...
 

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