VisibleControls - null?

Sep 13, 2010 at 10:50 AM

In the latest builds I'm having trouble with a custom Listview Item that worked ok previously.

It's inherited from Item and ICompositeControl, and is basically a checkbox and some text in a Panel

When I do VisibleControls.Add(panel); I get an unhandled exception as VisibleControls is null. This worked ok previously - what's the recommended way to do this now? I tried inheriting from VirtualItem instead, which the new listview item controls use, but the same thing happens. Looking a the source for those they don't seem to use controls, but shapes so I can't really follow the same methodology...


Sep 13, 2010 at 11:54 PM

Item does not inherit from CompositeControl and does not override the GetVisibleControls() method. therefore VisibleControls is always null.

you can either use ContainerItem which offers a Control property and add a panel which contains all controls you want to add,  or you override the VisibleControls() method on your derived Item control to return a value.