I have a custom control derived from ListView
(say MyListView
). In the designer mode I define several ListViewGroup
s in it. Unfortunately, if I later use this control on a form, whenever I open the designer for this form, it adds the same set of groups to the MyListView
control. So after some editing there is a big number of duplicate groups in it.
It seems the form designer (not surprisingly) cannot recognize that the groups were already added in the MyListView
constructor and not in the form itself, so it should not add the code to generate them in InitializeComponent()
. Can I prevent this somehow?