protected override object CreateInstance(Type itemType)
        {
            ListViewGroupEx group = (ListViewGroupEx)base.CreateInstance(itemType);

            group.Name = this.CreateListViewGroupName((ListViewGroupCollectionEx)this.editValue);
            return(group);
        }
 internal void UpdateGroupNative(ListViewGroupEx group, bool invalidate = true)
 {
     using (NativeMethods.LVGROUP nGroup = new NativeMethods.LVGROUP(group))
     {
         nGroup.SetState(NativeMethods.ListViewGroupState.Collapsible, collapsible);
         SendMessage(NativeMethods.ListViewMessage.SetGroupInfo, group.ID, nGroup);
     }
     if (invalidate)
     {
         base.Invalidate();
     }
 }
 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
 {
     if (destinationType == null)
     {
         throw new ArgumentNullException("destinationType");
     }
     if ((destinationType == typeof(InstanceDescriptor)) && (value is ListViewGroupEx))
     {
         ListViewGroupEx group       = (ListViewGroupEx)value;
         ConstructorInfo constructor = typeof(ListViewGroupEx).GetConstructor(System.Type.EmptyTypes);
         if (constructor != null)
         {
             return(new InstanceDescriptor(constructor, null, false));
         }
     }
     if ((destinationType == typeof(string)) && (value == null))
     {
         return("None");
     }
     return(base.ConvertTo(context, culture, value, destinationType));
 }
 internal void SetGroupState(ListViewGroupEx group, NativeMethods.ListViewGroupState item, bool value)
 {
     NativeMethods.LVGROUP mgroup = new NativeMethods.LVGROUP(NativeMethods.ListViewGroupMask.State);
     mgroup.SetState(item, value);
     SendMessage(NativeMethods.ListViewMessage.SetGroupInfo, GetGroupId(group), mgroup);
 }