public ListGroup() : base() { defaultContextMenuStrip = new ContextMenuStrip(); defaultContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(regularListViewMenu_Opening); this.ContextMenuStrip = defaultContextMenuStrip; _Columns = new ListGroupColumnCollection(this); _Items = new ListGroupItemCollection(this); // The Imagelist is used to hold images for the expanded and contracted icons in the // Left-most columnheader: this.SmallImageList = new ImageList(); // The tilting arrow images are available in the app resources: this.SmallImageList.Images.Add(COLLAPSED_IMAGE_KEY, Properties.Resources.CollapsedGroupSmall_png_1616); this.SmallImageList.Images.Add(EXPANDED_IMAGE_KEY, Properties.Resources.ExpandedGroupSmall_png_1616); this.SmallImageList.Images.Add(EMPTY_IMAGE_KEY, Properties.Resources.EmptyGroupSmall_png_1616); // The stateImageList is used as a hack method to allow larger Row Heights: this.StateImageList = new ImageList(); // Default configuration (for this sample. Obviously, configure to fit your needs: this.View = System.Windows.Forms.View.Details; this.FullRowSelect = true; this.GridLines = true; this.LabelEdit = false; this.Margin = new Padding(0); this.SetAutoSizeMode(AutoSizeMode.GrowAndShrink); this.MaximumSize = new System.Drawing.Size(1000, 300); // Subscribe to local Events: this.ColumnClick += new ColumnClickEventHandler(ListGroup_ColumnClick); }