/// <summary> /// Get the current state of this group from the underlying control /// </summary> protected int SetState(GroupState newState, GroupState mask) { NativeMethods.LVGROUP2 group = new NativeMethods.LVGROUP2(); group.cbSize = ((uint)Marshal.SizeOf(typeof(NativeMethods.LVGROUP2))); group.mask = (uint)GroupMask.LVGF_STATE; group.state = (uint)newState; group.stateMask = (uint)mask; return(NativeMethods.SetGroupInfo(this.ListView, this.GroupId, group)); }
/// <summary> /// Insert a native group into the underlying control via a ListViewGroup /// </summary> /// <param name="olv"></param> public void InsertGroupOldStyle(AdvancedListView olv) { this.ListView = olv; // Create/update the associated ListViewGroup if (this.ListViewGroup == null) { this.ListViewGroup = new ListViewGroup(); } this.ListViewGroup.Header = this.Header; this.ListViewGroup.HeaderAlignment = this.HeaderAlignment; this.ListViewGroup.Name = this.Name; // Remember which OLVGroup created the ListViewGroup this.ListViewGroup.Tag = this; // Add the group to the control olv.Groups.Add(this.ListViewGroup); // Add any extra information NativeMethods.SetGroupInfo(olv, this.GroupId, this.AsNativeGroup(false)); }