I am getting an InvalidCastException when there are 2 different classes at the same level of the tree hierarchy. For example, I have an MvDirectory class and an MvFile class. They both implement an int property called Size. They also share a common interface that implements Size. If I have a level of the hierarchy that consists of only MvDirectory instances, the filtering works fine. As soon as I add an instance of MvFile to the same level, I get an exception saying that MvFile cannot be cast to MvDirectory. I'm not sure why it is assuming all nodes at the same level are of the same type. Is there some way of getting it to use the shared interface or am I going to have to populate my tree with instances of the same class? Or am I just missing something?
Thanks,
Joe
Thanks,
Joe