protected override void CreateGroups(IEnumerable<OLVGroup> groups)
{
// In a virtual list, we cannot touch the Groups property.
// It was obviously not written for virtual list and often throws exceptions.
NativeMethods.ClearGroups(this);
this.EnableVirtualGroups();
foreach (OLVGroup group in groups) {
System.Diagnostics.Debug.Assert(group.Items.Count == 0, "Groups in virtual lists cannot set Items. Use VirtualItemCount instead.");
System.Diagnostics.Debug.Assert(group.VirtualItemCount > 0, "VirtualItemCount must be greater than 0.");
group.InsertGroupNewStyle(this);
}
}