I'm using the GroupBar control in a project where the GroupBarItems are added dynamically in code from a database. The layout consists of a static GroupBar added at design-time with three GroupBarItems. Each item.Client is another GroupBar which as several items of which each item.Client is a ListView. So in essence I have a ListView inside of a GroupBarItem which his inside of another GroupBarItem. It looks something like this:
The problem is, after I update the database and clear the main GroupBar using gbMain.Items.Clear() and then repopulate the GroupBar from the database there are still remnants of the old items. For example, if I go into the database and delete all of the SubBar items and ListView items and then repopulate I get things like this:
It's as if the main GroupBar is not resetting or reinitializing completely. Quitting the program and running it again fixes the issue until I make another change. I've tried calling gbMain.Referesh() and gbMain.Invalidate() after the gbMain.Clear() to force a redraw but it doesn't seem to make a difference. Is there a way to completely clear all of the items our of a GroupBar so I can repopulate?