I'm looking to put these into a ListView, so basically rather than a list of text in columns, a list of groupboxes.
listView1.Controls.Add(new NewsBox());
The above works for the first box, but doesn't show any ones after that.
How would I go about accomplishing what I need?
Sam HobbsPosted Nov 21, 2010, 4:18 AM
The items in a listview are added to the Items collection, not the Controls collection. I don't know what is happening by adding NewsBox objects to the Controls collection but I would not expect it to do what you are trying to do.
Hirendra SisodiyaPosted Nov 20, 2010, 3:23 AM
check the items count of listview after adding one gruopbox and check again items count of listview after adding second groupbox, for doing this you can know that groupbox are adding in listview successfully or not....once you confirm that your code for adding groupbox more that one working properly than it can happen the groupbox are adding in listview on same place or may be it is all happening because of property setting of listview like Groups,Autoarrange,Alignment,Sorting or column setting..
thanks
please mark as answer if it helps